JAVA 7 easy solution


#1
public class Solution {
    public int diffPossible(int[] A, int B) {
        for(int j = A.length-1 ; j >= 0 ; j--){
            for(int i = 0;i<j;i++){
                if(A[j] - A[i] == B){
                    return 1;
                }
                if(A[j] - A[i] < B){
                    break;
                }
            }
        }
        return 0;
    }
}