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) {
if(index>nums.length()){
return false;
}
else if(nums[index]==6){
return true;
}
else return arrays6[nums,index+1];
}
/*- check if index >= array size
- if yes, return false
- check if nums[index] == 6
- if yes, return true,
- return array6 function call passing nums and index+1*/
Compile problems:please advise
Error: else return arrays6[nums,index+1];
^
Syntax error on token ",", . expected
see Example Code to help with compile problems
If you are experiencing a similar issue, please ask a related question
Title | # Comments | Views | Activity |
---|---|---|---|
MySQL on Tomcat | 8 | 46 | |
Problem to refer to value | 8 | 49 | |
difference between sorce folder and folder in eclipise | 3 | 13 | |
Adding multiple JVM environments to RedHat 6 | 7 | 22 |
Join the community of 500,000 technology professionals and ask your questions.