+ 1
can anyone write java code for thiss
python to java def alternating(l): if(len(l)>1): if(l[0]>l[1]): for i in range(len(l)-1): if(l[i]==l[i-1]): return False if(i%2==0): if(l[i]<l[i+1]): return False if(l[0]<l[1]): for i in range(len(l)-1): if(i%2==0): if(l[i]>l[i+1]): return False return True
4 Answers
+ 5
You can do it!
Just Believe
- Code it with Java
- link code from the playground
+ 3
Link the playground code to show your attempt
patse the code url
or
press [ + INSERT ] on new comment
0
getting exceptions
0
i dont know much about java