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();
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
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.
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- th-cam.com/users/view_all_playlists?nv=1 Once we add more solutions based on that we will update our playlist as well.
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; }
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 TH-cam..which provide hackker solution.i really appreciate your hard work...m request you pls cover maximum solution of hackker and hackker earth
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 ..!! 🙏🙏🙏
Sir, if my mobile is hacked I will what to do?
We do not provide any content related to hacking.
What if there is 2 or more than 2 consecutive thunder cloud(1) is present between the array?? what will be your output??
I think your solution won't terminate in this exception because your loop always has 1 increment with count of 1 for sure
@@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!
Thanks for the feedback 🙂
If you find it helpful, please do share with others
Thanks for guiding us through this exercise and breaking down the steps! ^^ And yes, I do indeed want to be a cool dude in front of my friends.
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.
Thank you for such a nice feedback 😊
OMG I love you man, lol! I was complicating myself a lot and never thought of this solution. Thank you so much
Glad I could help!
Great explanation Sir.really commendable.....Thank you for your effort and making us learning....
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();
Wow 🤩 .. Exellent teaching .. Thank you very much
So nice of you
Amazing. Im a fan now!
Thank you 😊
Wow, you do a very good job in cracking all of those HackerRank questions. Very impressed. Thank you.
most welcome :)
i easily understand this logic..thanks for helping..
thank you 😊
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
Thanku sir your teaching style very easy and understandable thnks sir😍❤️ love for ur teaching
Thanks and welcome
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
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.
If I am doing somewhere mistake, please let me know.
Did you watch this video completely without skipping or forwarding??
Because i have explained this in this tutorial.
That is what I did, too. i < len - 1
16:40
@@JavaAidTutorials i watched the whole vid. it comes out right too, but is it wrong or can we do it like that too.
Dear sir you are doing great job the students like me.Please sir complete the hackerrank playlist.
Sure I will
brilliant solution thank you so much
Where you gone , Please come back and explain us more Hackerrank question :'( .You're the only TH-camr who does it.Please Come Back.
Coming soon..😊
Thanks a lot for this explanation..💯💯
Glad it was helpful!
thanks a lot for such a great explanation, and for such helpful solution videos.
Glad it was helpful!
Your excellent brother plz do vedios on interview bit questions also brother 👌👌👌👌 explanation
We will try.
Thank you sir 😊
Nice Explanation :)
Thanks 🙂
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-
th-cam.com/users/view_all_playlists?nv=1
Once we add more solutions based on that we will update our playlist as well.
@@JavaAidTutorials this url is broke
Myfriend ) thank you! yoa are awesome! if you have any extra time , pleas do video about "cavity map" problem , and "Matrix Layer Rotation" ))
will review this problem if its good problem will definitely upload tutorial on that.
@@JavaAidTutorials thank for your reply, bro!)
Gr8 explanations...one questions...which editor/tool you have used for the text and drawings?
i use microsoft onenote.
Bro plz make a video on repeated string
Sure, just wait for some time, will upload the solution for this soon..
great explanation
thank you. 🙂
can u plz explain why did he take i+2 in the if condition??
Can you please solve fradulent activity notification and Sherlock and the valid string?
Will upload the solution for more problems once the lockdown overs.
if there is a complex program. can I use the inbuilt function as an online test (java)?like Arrays.sort......?
Hackerrank does not stop you to use any inbuilt function. You can use it in online test as well.
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;
}
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
Please make a video on "Between Two Sets" hackerrank problem
will try to upload for this but need some time.
till then stay tuned.
Thanks
Tqsm sir
Welcome
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
When u are making upcoming videos
got stuck due to LOCKDOWN without my personal laptop :(.
So no uploads from 2 months.
Can you make video on manacher's algorithm
will try our best but due to lockdown not able to upload any content.:(
Program starts @13:00
Please solve the angry children 2 problem..
Is it cover all the questions from hacker rank???
not all but most of the questions are covered in my hackerrank playlist, we will continue to add more
@@JavaAidTutorials thanks it is one the best play list on TH-cam..which provide hackker solution.i really appreciate your hard work...m request you pls cover maximum solution of hackker and hackker earth
Thanks for the feedback 😊
We are working on it. If you find our channel helpful, please support us by sharing it with your friends.
How can I solve any problem
can you solve the poisonous plant problem
I can solve that problem but need some time to make a tutorial on this.
Sir I dint get y exactly is count=-1
Did you watch this video completely without skipping or forwarding??
Because i have explained this in this tutorial.
16:40
dude, this throws me error after the first two test cases.
me also 3 test case error
my solution: ´´´function jumpingOnClouds(c) {
// Write your code here
let jump=0
let length =c.length
c.reduce((prev,curr,index) =>
{let r= prev +1 ;
if (r===2 ){ jump+=1 ;curr===1 ? r= 1 : r=0 }
else if( r===1 && index===length-1){jump+=1}
return r
})
return jump
}´´´
Tell me output for this input [0 0 0 0 1 1 1 0]
the count will increase in this case.
Nic3
I not understand why u put count -1
Did you watch this video completely without skipping or forwarding??
Because i have explained this in this tutorial.
16:40
we can do one thing ki for loop i to array.length-1 tak chala lo , tab count ki value -1 ke jagah 0 intialise kar sakte ho, sir m i ryt?