I am working on below challenge. http://codingbat.com/prob/p108997
Psedo code:
1. create new array of the portion of original array length
2. fill new array with rest of the elements
3. check to see if it has 6 if yes return true if no return false
4. retrun above boolean
I wrote my code as below
public boolean array6(int[] nums, int index) { int len=nums.length-index; int[] num=new int[len]; //fill without using for loop but recursive way if(num.length==0){ return false; } if(num.length==1&&!num.contains(6)){ return false; } if(num.length==1&&num.contains(6)){ return true; } return null;}
public boolean array6(int[] nums, int index) {
IntStream.of(nums).anyMatc
}