If you find this tutorial helpful, please do not forget to like , comment, share and It would be great if you can leave your feedback about the tutorial, as I have put a lot of hard work to make things easy for you. Thanks ..!! 🙏🙏🙏
@@albatrossmullick8929 The premise of the problem says the game can always be won. So my interpretation is that there are no two consecutive number 1s in the array.
Man, I can't thank you enough. I couldn't understand the problem right through the website description but once I heard you explain I got it. Your explanations are great, simple to understand and helpful to improve my skills. Keep going with those tutorials, they are of great help!
Kanhaiya you are doing really good work, it shows you are selfless and you care about us. This is how our country is gonna develop. Keep uploading such videos.
Thanks for the tutorial.. We also can write a more concise code using java 8 string s = abc; int n=10; while(s.length() (char)c).filter(ch -> ch.equals('a')).count();
Hello sir, instead of doing count = -1 We can use the condition on for loop that is i< array.length-1 So that time take to execute one time for loop will be saved.
I was able to write the code on my own but i was getting array out of bound, but after getting proper explanation i was able to solve my issue no need to wait for coding part in video
hi what if the array has continuous '1's, i+1 and i+2 both are '1' in this case would you jump and count the jump or skip ? [0,1,0,0,0,1,0,0,1,1,1,1] - what is the output (if you avoid 1's in the last short distance would be 4, if you count on 1's it would be 8
i have found a solution but idk wether its optimistic or not public static void main(String[] args) { int arr[] = {0,0,1,0,1,0,1,0,0,0,1,0}; //6 int step =0; int i =0; while(i
We can also use continue keyword in JAVA, For example i use this in C# Here my solution private static int JumpinClouds(int[] n) { int numOfJump = 0; for (int i = 0; i < n.Length; i++) { int newIndex = i + 1; if (newIndex < n.Length) { if (n[newIndex] == 0) { i++; numOfJump++; continue; } } numOfJump++; } return numOfJump; }
Hi sir you are doing very great job for us, do you have playlist in which we have topic wise solutions. Like we start with greedy and its problems,game theory and problems, recursion and problems like this.
thanks for the feedback @Gagan but currently we do not have playlist for all categories. we have some useful playlist which i would request you to check based on your need. here is the link- ru-vid.com_all_playlists?nv=1 Once we add more solutions based on that we will update our playlist as well.
problem in my python code def jumpingOnClouds(c): count = -1 for i in range(len(c)-2): if i+2 < n and c[i+2]==0: i += 2 print() else: i+=1 count+=1 return count if __name__ == '__main__': n = int(input()) c = list(map(int, input().rstrip().split())) result = jumpingOnClouds(c) print(result) test case 0 and 1 only passed rest all failed
@@JavaAidTutorials thanks it is one the best play list on RU-vid..which provide hackker solution.i really appreciate your hard work...m request you pls cover maximum solution of hackker and hackker earth