Equal Stacks HackerRank Solution | Data Structures | Stacks

preview_player
Показать описание
In this video, I have explained hackerrank equal stacks solution algorithm.
hackerrank equal stacks problem can be solved by using stack data structure. The complexity of equal stacks hackerrank solution is O (n1+n2+n3). This hackerrank problem is a part of Practice | Data Structures | Stacks | Equal stacks hackerrank challenge.

For simplicity, I have divided this hackerrank tutorial into three parts.
[00:00] Understanding the problem statement.
[03:56] Building the logic or algorithm to solve the problem.
[08:50] Coding the algorithm using java (you can use your own preferred programming language).

✚ Join our community ►

📖 Resources ►

✅ Recommended playlists ►

👋 Let’s Connect ►

#JAVAAID #equalstacks #HackerRankSolutions #HackerRankTutorials #HackerRank #JavaAidTutorials #programming #DataStructures #algorithms #coding #competitiveprogramming #java #codinginterview #problemsolving #KanahaiyaGupta #hackerrankchallenges
Рекомендации по теме
Комментарии
Автор

JAVAAID community: YouTube recently changed the way they monetize my content. My channel now needs 1, 000 subscribers so it would be awesome if you could show your support by both watching my videos and subscribing to my channel. please hit the like button too, if you find it useful. if you haven’t already done so. Monetizing my videos allows me to invest back into the channel with new equipment so a small gesture from you goes a huge way for me. Many thanks for your support!

JavaAidTutorials
Автор

Thanks for showing the solution i was not knowing how to do this task, but this help me understand the logic behind it !

minhhuyvo
Автор

At 13:22 it has a small bug in line number 59. You have put the same condition in both of them. you have to compare s2 > s3 and s2 > s1.

pankajrathi
Автор

Your tutorials provide the best explanations ever...! Please make more such videos Sir..!

shrutipawar
Автор

such a clean code impressed with your algorithm....!

sankeerthmeda
Автор

I have problems trying to find an algorithmic solution to problems... The way you saw the problem, I just couldn't see it. Of course after seeing the problem completely solved I'm like: "oh wow, I understand perfectly how he did it!" but I just can't solve them by myself.

josejvazquez-perez
Автор

Thank You Sir.I have written this code in Java and it works.

SwarnaliMollickA
Автор

Good explanation bhai .. your all tutorials are very useful and easy to understand..Thanks for sharing..

codingfreek
Автор

At first while lokking at the question the logic does not click in my mind and not able to think upto the mark...but after watching the videos I am able to understand the logic and solution....So is this the wrong way to practise DSA or something I can do to improve suggestion will be appreciable....Thanking you in advance....BTW your videos are really amazing and easy to understand....Thanks a lot for this effort....

zenshyam
Автор

on line 59, shouldn't u have s2height >= s1height
Thanks for the explanation tho.

nishchalbhardwaj
Автор

Thanks for the video..but submitting this in hackerrank, still many test cases fails. can you pls check.

mohantraju
Автор

Can we improve the conditional check to something like this if(A>=B && A>=C) popA(); else if(B>=C) popB(); else popC() ??

RohanKKayan
Автор

Can you also explain waiter problem ??

ruchikachirania
Автор

Hello sir, thanks for making a video on equal stacks problem. Sir I want to know how to write optimized code for a problem. Can u guide me. Waiting for ur reply

rakeshk
Автор

Sir thanks for not just sharing the info but also teaching us how to be a better programmer..and can u advice on what it really takes to be good at problem solving?

rdrahuldhiman
Автор

why we start loop from backwad ? why we want first element to come top of stack ? can we use normal loop from start to end

topthingwhichyoushouldkn
Автор

Hello,
I have understood the answer but still i think it need some modification.
In the 59th line of the solution why using same condition twice also seems like that line condition is not right as it's not checking the value of second sum with the first value of first sum?

subratasen
Автор

Great explanation, Thanks for sharing.

ravipanchal
Автор

sir why have u used >= sign from in line 57 59 61..
u could have used > sign..
plzz reply

qRpKsJt
Автор

Thank you sir.
I too have the same approach as you but I got TLE so.. I came here. And amazed by your solution as the logic was same but I can't implement it. But after your explanation video. It is feeded in my memory.

Ps. Can you tell me is java is good enough for competitive programming? Or should I switch to C++?

eklavyaprasad