Тёмный
shashCode
shashCode
shashCode
Подписаться
Hi I am Shashwat Tiwari, software engineer at Samsung Research. I enjoy solving problems using coding and other computer science stuff. This channel is for sharing knowledge on programming, computer science fundamentals, data structures and algorithms, and a lot more with touch of motivational talks. You can get free courses, learn how to code, how to start programming, how to prepare for Interviews and everything in between.

Learn to develop in hindi
Learn to code in hindi

Btw Hindi is my language , programming language could be java, python, c++, javascipt, go lang.

Feel free to dm me whenever you want: linktr.ee/shashwat_tiwari_st
Комментарии
@Amjad_GamingYT
@Amjad_GamingYT 3 часа назад
Bhai tum har baar neet code ke video ke baad same problem pe video daalte ho. Kya scene?
@GirjeshSharma-zv3xo
@GirjeshSharma-zv3xo 4 часа назад
love from russia❤
@yashmatlani1976
@yashmatlani1976 4 часа назад
I Had a slightly different approach to this question . Instead of storing characters in stack , i maintained the index of last opening bracket whenever i encountered a closing one . and used a reverse function and made the recursive calls Below is my Code with Linear TC class Solution { string recur(string s,int idx,string res){ if(idx>=s.length()){ string final_ans = ""; for(char i : res){ if(i=='(' || i == ')') continue; final_ans += i; } return final_ans; } if(s[idx]=='(') { s1.push(idx+1); } if(s[idx]==')') { res = Rev(res,s1.top(),idx-1); s1.pop(); } return recur(s,idx+1,res+s[idx]); } string Rev(string s1,int s,int e){ while(s<=e){ char a = s1[s]; s1[s] = s1[e]; s1[e] = a; s++; e--; } return s1; } public: stack<int> s1; string reverseParentheses(string s) { string res = ""; return recur(s,0,res); } }; Also Ty Very Much i was having hard time learning recursion but this intiution came from your stack and recursion series.
@shashwat_tiwari_st
@shashwat_tiwari_st 3 часа назад
@@yashmatlani1976 impressive 👏 👌 great progress ✨️
@maniprakash6960
@maniprakash6960 5 часов назад
Sir, please explain in English
@shashwat_tiwari_st
@shashwat_tiwari_st 5 часов назад
Like target of today's videos is 90. Please do like if you understood the solution 😊
@arnab_bhadra_0375
@arnab_bhadra_0375 5 часов назад
my approach was quite similar with your first approach ,only difference is that i didnt take any list i just considered a dummy string and manipulated it multiple times,but at last shocked by seeing n^2 complexity thatys why i was waiting for your video.
@shashwat_tiwari_st
@shashwat_tiwari_st 5 часов назад
String manipulation java me slow hota hai.. StringBuilder se try krlo instead of string, thoda better hoga but not very efficient.
@PiyushSharma-we8yd
@PiyushSharma-we8yd 5 часов назад
3:30 - Stack Approach 10:11 - Code for stack 13:27 - Approach 2 ( jo mai sapne me thanos ban kr sare infinity stones lekr bhi khud se nahi soch pata ) 23:45 - Code for Approach 2
@PiyushSharma-we8yd
@PiyushSharma-we8yd 5 часов назад
First view sir
@vikasmandloi6438
@vikasmandloi6438 6 часов назад
thank you very much 🥰
@mr.nishantawasthi4402
@mr.nishantawasthi4402 9 часов назад
Good explain sir ❤
@theritesh973
@theritesh973 9 часов назад
❤❤❤
@theritesh973
@theritesh973 9 часов назад
❤❤❤
@nitishrai6239
@nitishrai6239 18 часов назад
After solving questions by myself coming here daily to learn a better approach, but I did exactly the same approach today . Gaining confidence to solve questions Thanks.
@harikrushnapatel4577
@harikrushnapatel4577 19 часов назад
Sir jo naye videos aye hai aur jo leetcode questions relate hote hai use topic wise playlist me arrange karke dijiye ga ye hi playlist mai please
@vivekgosai7913
@vivekgosai7913 19 часов назад
Why we can't use == operation to check what difference they both have
@shashwat_tiwari_st
@shashwat_tiwari_st 19 часов назад
@@vivekgosai7913 == is used for address comparison, whereas equals is used for value comparison. String a = "sha"; String b = "sha"; a==b will be false. a equals b will be true.. understood? You can watch String lectures in java dsa playlist, that will be helpful 😄
@vivekgosai7913
@vivekgosai7913 18 часов назад
@@shashwat_tiwari_st Thanks 🙏🏻
@Aranya_-il5nr
@Aranya_-il5nr 19 часов назад
Hey sir can you tell the approach from which video do I need to start with and how can we utilise your channel in beginners manner + from which video can we expect to solve leetcode problems
@shashwat_tiwari_st
@shashwat_tiwari_st 19 часов назад
@@Aranya_-il5nr if you don't know Java, please watch from lecture 1 of Java dsa sheet, after lecture 15, you can start solving leetcode daily challenge videos in parallel, along with Java dsa lectures. If you already know Java, basics then you can start watching from lecture 11 of Java dsa playlist and watch daily challenge problems in parallel.
@Aranya_-il5nr
@Aranya_-il5nr 18 часов назад
@@shashwat_tiwari_st ok sir
@debapriyo007
@debapriyo007 19 часов назад
Sir the way u explain and dry run each and every concept is very clear to me .I know it's Adv DS but seems to be easy. respect for the effort u r putting. thanks for making this Graph series.. Love u and respect.🫡❤
@tejas2636
@tejas2636 20 часов назад
Sir ye same questions kaa Trie Data Structure use krke optimize solution milega kya..??
@shashwat_tiwari_st
@shashwat_tiwari_st 19 часов назад
tries se searching easily hoti hai, generation me help nhi krega tries.
@tejas2636
@tejas2636 19 часов назад
@@shashwat_tiwari_st Sir to fir apan Trie mein jo possible words list mein available haii unhe trie mein insert krke search kr skte na.. If word found we will mark endOfWord false or remove it from trie.. Is it possible??
@shashwat_tiwari_st
@shashwat_tiwari_st 18 часов назад
@@tejas2636 ha woh mai smjha, Tries se kr skte ho but optimization kaha hai, Jaise word generate kra tmhe let's say "aman", Hashset me constant time me pta lag jaega ki present hai ya nhi Tries me string ki length tak traverse krke pta chalega.. So, Tries optimized toh nhi hua yaha pr...
@tejas2636
@tejas2636 18 часов назад
@@shashwat_tiwari_st okok..
@hrithikmulik8480
@hrithikmulik8480 20 часов назад
Yeh toh DNF ho gaya
@arneshbasak1910
@arneshbasak1910 20 часов назад
Sir ap itna acha parate ho islia apke channel future aur grow karega 🎉
@HA000_edits
@HA000_edits 21 час назад
Sir leetcode problem no 2952 ka solution viedo upload kar dijiye bohot confusion hai half test cases hi pass ho rahe hai please sir ❤ bohot try Kara solve karne ka
@RohitKumar-dz8dh
@RohitKumar-dz8dh 22 часа назад
Thanks 😊
@shashwat_tiwari_st
@shashwat_tiwari_st 21 час назад
@@RohitKumar-dz8dh ✨️✨️
@kunalsarpal7564
@kunalsarpal7564 23 часа назад
got it
@kunalsarpal7564
@kunalsarpal7564 День назад
got it❤❤❤❤❤❤
@singhvivek5098
@singhvivek5098 День назад
I have solved this question on my own , easy one
@saiei
@saiei 23 часа назад
cho prroud of u
@shashwat_tiwari_st
@shashwat_tiwari_st 21 час назад
@@singhvivek5098 badhiya
@saisree04
@saisree04 День назад
amazing and simple as always
@kunalsarpal7564
@kunalsarpal7564 День назад
Got it ........
@krutikadave4534
@krutikadave4534 День назад
I come back to your videos if I want to understand something in the most simplified way. Thanks for knowledge.
@shashwat_tiwari_st
@shashwat_tiwari_st 21 час назад
@@krutikadave4534 😄😄
@onkarhol
@onkarhol День назад
love you dada🥰
@adarshjain3058
@adarshjain3058 День назад
question toh bahana hai....hume toh attendance lagana haii😌 int main(){ cout<<"attendance++"; }
@adarshjain3058
@adarshjain3058 23 часа назад
@@saiei rojj karungaa.... Tu rojj chidega.. Majaa aayega😌
@shashwat_tiwari_st
@shashwat_tiwari_st 21 час назад
@@adarshjain3058 good good✨️👏
@motivationalquotes6581
@motivationalquotes6581 День назад
I will tag on linkedin
@shashwat_tiwari_st
@shashwat_tiwari_st 21 час назад
@@motivationalquotes6581 thankyou, means a lot ❤️
@GirjeshSharma-zv3xo
@GirjeshSharma-zv3xo День назад
Love from England❤
@saiei
@saiei 23 часа назад
what is sharma doing in england
@AnkitYadav-dm7fp
@AnkitYadav-dm7fp 19 часов назад
kl to australia se love de rha tha aaj england ? lgta h world tour pr ho
@PiyushSharma-we8yd
@PiyushSharma-we8yd День назад
today I solved by my own. But tree visualisation is best. Thankyou 🤩
@shashwat_tiwari_st
@shashwat_tiwari_st 21 час назад
@@PiyushSharma-we8yd 😄😄
@shashwat_tiwari_st
@shashwat_tiwari_st День назад
Like target of this video is 90. If you understood the problem please do like.
@krutikadave4534
@krutikadave4534 День назад
This video deserves thousands of likes 😄
@saiei
@saiei 23 часа назад
liked bhai
@RohitKumar-dz8dh
@RohitKumar-dz8dh День назад
Thanks 😊
@thAsciNileshPal
@thAsciNileshPal День назад
samjhate theek ho ,but thoda dheere samjhaya kro ; bhaot speed me expalin karte ho ...time leke explain kiya kro
@shankitkumar820
@shankitkumar820 День назад
No, His speed is just fine. If he will make long videos of each question then no one will get interested as every video will be atleast half hour long. I would recommend you to try each and every step yourself and ask doubt on comment section.
@thAsciNileshPal
@thAsciNileshPal День назад
@@shankitkumar820 ha to khudse hi to kar raha code , konsa sir muje type kar k de rahe
@RahulKumar-et4pm
@RahulKumar-et4pm День назад
basic question of cpu scheduling of Operating System.
@a3rdtierguy864
@a3rdtierguy864 День назад
If someone solved merge interval he will definitely able to solve this.
@mr.nishantawasthi4402
@mr.nishantawasthi4402 День назад
Great
@saisree04
@saisree04 День назад
Thank youu, your explanation is super simple and easy to follow. I am glad that i found your channel.
@user-cr8pd4gn9t
@user-cr8pd4gn9t День назад
Clear Explanation...thanks bro...!!
@keshavgupta9174
@keshavgupta9174 2 дня назад
class Solution { public double averageWaitingTime(int[][] customers) { int n = customers.length; double totalWaitTime = 0; int currTime = 0; for (int[] customer : customers) { int arrivalTime = customer[0]; int cookTime = customer[1]; if (currTime < arrivalTime) { currTime = arrivalTime; } int waitTime = currTime + cookTime - arrivalTime; totalWaitTime += waitTime; currTime += cookTime; } return totalWaitTime / n; } }
@AmandeepSingh-kr6he
@AmandeepSingh-kr6he 2 дня назад
its fails on {6, -3, -10, -4, 0, 2}
@apoorvarya3
@apoorvarya3 2 дня назад
भैया जी धन्यवाद 🙏
@THOSHI-cn6hg
@THOSHI-cn6hg 2 дня назад
C++ code bhi do plz
@adarshjain3058
@adarshjain3058 2 дня назад
attendance++;
@RohitKumar-dz8dh
@RohitKumar-dz8dh 2 дня назад
Thanks 😊
@Rahul_Mongia
@Rahul_Mongia 2 дня назад
2^o(n)+o(1) = 2^o(n)
@GirjeshSharma-zv3xo
@GirjeshSharma-zv3xo 2 дня назад
Love from Urgentina❤
@GirjeshSharma-zv3xo
@GirjeshSharma-zv3xo 2 дня назад
Love from Australia❤