+ 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

22nd Feb 2018, 5:19 AM
Leela Karthik Uttarkar
Leela Karthik Uttarkar - avatar
4 Answers
+ 5
You can do it! Just Believe - Code it with Java - link code from the playground
22nd Feb 2018, 5:22 AM
Manual
Manual - avatar
+ 3
Link the playground code to show your attempt patse the code url or press [ + INSERT ] on new comment
22nd Feb 2018, 5:29 AM
Manual
Manual - avatar
0
getting exceptions
22nd Feb 2018, 5:24 AM
Leela Karthik Uttarkar
Leela Karthik Uttarkar - avatar
0
i dont know much about java
22nd Feb 2018, 5:24 AM
Leela Karthik Uttarkar
Leela Karthik Uttarkar - avatar