Тёмный
Ayushi Sharma
Ayushi Sharma
Ayushi Sharma
Подписаться
I am working as Software Engineer 2 at Microsoft. Previously, worked as Software Engineer 3 at Walmart Global Tech India.
A channel to make people fall in love with Data structures and Algorithms. I have started solving Love Babbar DSA Cracker sheet and solve Leetcode daily challenges. Feel free to connect with me on the below ID's for any queries and suggestions.😃

Connect with me on Instagram : instagram.com/ayushisharma83/
Connect with me on LinkedIn : www.linkedin.com/in/ayushi-sharma-8a285a185/
Book a session with me on Topmate : topmate.io/ayushi

For collaborations and promotions, please reach out to me at ayushisharma5141@gmail.com
Ugly Number II | Leetcode 264
28:29
14 часов назад
Комментарии
@tushar_pawar040
@tushar_pawar040 10 часов назад
class Solution { public String decodeString(String s) { Stack<Integer> stNum = new Stack<>(); Stack<StringBuilder> stStr = new Stack<>(); StringBuilder currStr = new StringBuilder(); int currNum = 0; for(char ch : s.toCharArray()) { if(ch == '[') { stNum.push(currNum); stStr.push(currStr); currNum = 0; currStr = new StringBuilder(); } else if(ch == ']') { int num = stNum.pop(); StringBuilder prevStr = stStr.pop(); String s1 = currStr.toString(); currStr = prevStr.append(s1.repeat(num)); } else if(ch >= '0' && ch <= '9') currNum = currNum * 10 + ((int)ch - 48); else currStr.append(ch); } return currStr.toString(); } }
@tushar_pawar040
@tushar_pawar040 10 часов назад
java with 0 ms Beats 100.00%
@harshchaudhary715
@harshchaudhary715 11 часов назад
Great explanation
@AyushiSharmaDSA
@AyushiSharmaDSA 9 часов назад
Thank you :)
@mrepic2797
@mrepic2797 16 часов назад
thnks
@AyushiSharmaDSA
@AyushiSharmaDSA 12 часов назад
Welcome :)
@abhishekanand8574
@abhishekanand8574 17 часов назад
thanku mam
@AyushiSharmaDSA
@AyushiSharmaDSA 12 часов назад
Welcome :)
@rohitvhanmore8742
@rohitvhanmore8742 День назад
2d k problem jaldi samjh nhi aata...😩
@deepanshuagarwal2471
@deepanshuagarwal2471 День назад
Mam I solved that by using naive approach by my own but i understand efficient one by seeing a solution i am asking that when u solve that problem first time you can able to solve it efficient logic by own
@AyushiSharmaDSA
@AyushiSharmaDSA День назад
I was able to think up till the better one, but did know that we had to do it O(1) space complexity. Using the given matrix to keep a track and the C0 flag was a learning for me as well in this problem :)
@deepanshuagarwal2471
@deepanshuagarwal2471 День назад
@@AyushiSharmaDSA yup I was also able to right a better approach by my own
@rishiraj2548
@rishiraj2548 День назад
Hey👋🏻🙂
@samiranroyy1700
@samiranroyy1700 День назад
Di nice explanation ❤
@AyushiSharmaDSA
@AyushiSharmaDSA День назад
thank you :)
@samiranroyy1700
@samiranroyy1700 День назад
@@AyushiSharmaDSA yes di
@palakkumrawat6878
@palakkumrawat6878 День назад
Di Your videos are always simple and helpful
@AyushiSharmaDSA
@AyushiSharmaDSA День назад
Thanks a lot Palak😊
@faisalfftamil7814
@faisalfftamil7814 2 дня назад
From your linked in , wonderful series keep updating...
@AyushiSharmaDSA
@AyushiSharmaDSA 2 дня назад
Thank you :)
@MayankRathore-qi7qv
@MayankRathore-qi7qv 2 дня назад
Meine bahut lecture dekh liye iss question per meroko smgj nhi aaya yeh question shi se ur iss video mein bhi smj nhi paa raha hoon
@hitanshushah9069
@hitanshushah9069 2 дня назад
overall cost with video ?
@alanguagee
@alanguagee 2 дня назад
its same like my office might be vary 😆😆 btw, watching after one two year
@shantipriya370
@shantipriya370 3 дня назад
wonderful explanation...
@AyushiSharmaDSA
@AyushiSharmaDSA 3 дня назад
thank you! glad u liked it :)
@lofified29
@lofified29 3 дня назад
Completed whole Playlist in 1 go. Waiting for more medium to hard array problems.🙂
@AyushiSharmaDSA
@AyushiSharmaDSA 3 дня назад
waooooo, that's amazing 🙌🙌✨ sure, more videos coming up in upcoming days, both array medium and hard! :)
@rohitvhanmore8742
@rohitvhanmore8742 3 дня назад
Isme swapping ka code brute force mein chaiye tha... toh aur deep mein samjh aata
@AyushiSharmaDSA
@AyushiSharmaDSA 3 дня назад
noted.... thanks for your valuable feedback! :)
@rohitvhanmore8742
@rohitvhanmore8742 3 дня назад
@@AyushiSharmaDSA 👍
@GopalKumar-xu3iw
@GopalKumar-xu3iw 3 дня назад
Mam daily ek vedio daal do practice ho jayega ek question per day
@AyushiSharmaDSA
@AyushiSharmaDSA 3 дня назад
yup sure :)
@GopalKumar-xu3iw
@GopalKumar-xu3iw 2 дня назад
@@AyushiSharmaDSA hmm
@GopalKumar-xu3iw
@GopalKumar-xu3iw 2 дня назад
@@AyushiSharmaDSA ye bataye pehle khud se try karna h ya aapka vedio dekhna ye doubt clear kariye plz
@AyushiSharmaDSA
@AyushiSharmaDSA 2 дня назад
@@GopalKumar-xu3iw 5 mins khud se try kro, phir video dekho :)
@rohitvhanmore8742
@rohitvhanmore8742 3 дня назад
Ma'am paid mentoring chalu karo aap .. you teach very well I'll will be your first student.
@AyushiSharmaDSA
@AyushiSharmaDSA 3 дня назад
hi Rohit, thank you. Paid nhi aap bas apne doston ke saath channel share krdo :)
@rohitvhanmore8742
@rohitvhanmore8742 3 дня назад
@@AyushiSharmaDSA free ka value nhi hota ma'am. 🥲 Pr kuch nhi krta hu share 👍
@deepanshuagarwal2471
@deepanshuagarwal2471 3 дня назад
Done mam you are amazing always ❤
@AyushiSharmaDSA
@AyushiSharmaDSA 3 дня назад
you are amazing tooo ❤️
@deepanshuagarwal2471
@deepanshuagarwal2471 3 дня назад
@@AyushiSharmaDSA didi please give tips for recursion and dp
@pmmodi3583
@pmmodi3583 3 дня назад
TQ MAM 😊
@AyushiSharmaDSA
@AyushiSharmaDSA 3 дня назад
welcome modiji 🤗
@pmmodi3583
@pmmodi3583 3 дня назад
@shanmukhtejareddy371
@shanmukhtejareddy371 3 дня назад
Hello Didi! please do solve today's lc. Not able to solve last 2 days daily questions🥲. Need ur help for sure🙏
@lifelovestory...2167
@lifelovestory...2167 3 дня назад
Great ❤
@nhariprasad-w5s
@nhariprasad-w5s 3 дня назад
If N is rows and M is columns, then it can be solved in M*N * LogN using heap. With space complexity of N
@yt_goluyadav
@yt_goluyadav 3 дня назад
Lovely ❤
@yt_goluyadav
@yt_goluyadav 3 дня назад
Great explanation even it is better than striver's explanation.
@AyushiSharmaDSA
@AyushiSharmaDSA 3 дня назад
Thank you so much 🤗
@HamsiniRamesh-ig6ih
@HamsiniRamesh-ig6ih 3 дня назад
Thanks for the nice explanation. Can you please solve sum of subarray minimums in simple way.
@AyushiSharmaDSA
@AyushiSharmaDSA 3 дня назад
Hii sure Can you pls share the problem link here
@HamsiniRamesh-ig6ih
@HamsiniRamesh-ig6ih 2 дня назад
@@AyushiSharmaDSA Hi, I'm not able to send the link here. Its leetcode 907 Sum of subarray minimums.
@AyushiSharmaDSA
@AyushiSharmaDSA 2 дня назад
@@HamsiniRamesh-ig6ih okay sure :)
@vamsiv5767
@vamsiv5767 3 дня назад
This code gives wrong answer for aabccbb
@AnkitRaj-mo5hb
@AnkitRaj-mo5hb 3 дня назад
Thank You Di,amazing explanation
@deepanshuagarwal2471
@deepanshuagarwal2471 4 дня назад
Amazing didi
@AyushiSharmaDSA
@AyushiSharmaDSA 4 дня назад
Thanks a lot deepanshu😊
@rishiraj2548
@rishiraj2548 4 дня назад
🙂👍🏻
@AyushiSharmaDSA
@AyushiSharmaDSA 4 дня назад
thank you Rishi 🤗
@rohitvhanmore8742
@rohitvhanmore8742 4 дня назад
Madam abh strings chalu karo..
@AyushiSharmaDSA
@AyushiSharmaDSA 4 дня назад
arey yr ruko, abhi array ki problems hai padi hui :) next week strings chalu ho jayega :)
@rohitvhanmore8742
@rohitvhanmore8742 4 дня назад
@@AyushiSharmaDSA abh jaise ki mein apka playlist follow kr raha hu...toh ek bar questions solve krne k badh Uska revision kaise kre ...ethna sabh different approaches yadh nhi rehta..
@AyushiSharmaDSA
@AyushiSharmaDSA 4 дня назад
saare questions revise nhi krne, jo different hai, vo kro :)
@rohitvhanmore8742
@rohitvhanmore8742 4 дня назад
@@AyushiSharmaDSA pr mere liye toh ye sabh new he hai : ( toh mujhe toh saare revise krne padenge na..
@gsmdfaheem
@gsmdfaheem 4 дня назад
Didi it astonishes me ki aap msft mai aakar bhi dsa grind on kr rkha hai. How to get this motivation. Mera toh office se nikalte hi mann hi nhi krta aur ye sab krneka. Want some tips
@AyushiSharmaDSA
@AyushiSharmaDSA 4 дня назад
yr I want to build something of my own and help community, since I have learned mostly from youtube, so I want to give it back :)
@gsmdfaheem
@gsmdfaheem 4 дня назад
@@AyushiSharmaDSA wow didi. You have a vision in sight which is keeping you going. Nice to hear
@gsmdfaheem
@gsmdfaheem 4 дня назад
​​@@AyushiSharmaDSA toh aap jo office ka kaam hai uske liye kuch tech stack related pdhna ho ya kuch kaise krna pata nhi ho toh uske related thoda gpt se trail and error krna, naye office work ka KTs, projects smjhna, uspe kaam ye sab kaise krlete ho didi along with this. How much time you spend for office stuff. I desperately need advice on office time management. Hence asking.
@Jv_Singh37
@Jv_Singh37 4 дня назад
this entire series will be in java ?
@AyushiSharmaDSA
@AyushiSharmaDSA 4 дня назад
code will be in all three languages- c++, java and python! :)
@mayanksrivastava4452
@mayanksrivastava4452 4 дня назад
nice solution 🫡, a bit of a funny part is "Hey guys, welcome all or welcome back to my channel". JK ! 😂😇
@AyushiSharmaDSA
@AyushiSharmaDSA 4 дня назад
😂😂😂 Its like for new folks, welcome And for the old one, welcome back :)
@shanmukhtejareddy371
@shanmukhtejareddy371 4 дня назад
hey! can u solve today's lc problem. Couldn't understand what to do
@AyushiSharmaDSA
@AyushiSharmaDSA 4 дня назад
hey, sure. let me check that now :)
@AyushiSharmaDSA
@AyushiSharmaDSA 4 дня назад
hey, sorry, caught up in office work, has a meeting. :(
@harishsonawane855
@harishsonawane855 4 дня назад
Solute to your dedication Ayush 🫡
@AyushiSharmaDSA
@AyushiSharmaDSA 4 дня назад
thank you :)
@rishiraj2548
@rishiraj2548 4 дня назад
💯💯
@HamsiniRamesh-ig6ih
@HamsiniRamesh-ig6ih 4 дня назад
Your logic explanations are really good. Thank you. Please upload for more questions of leetcode.
@AyushiSharmaDSA
@AyushiSharmaDSA 4 дня назад
thank you!. Sure, will complete the array playlist :)
@COURATWENTYTHREE
@COURATWENTYTHREE 4 дня назад
Short and Simple expalanation❤❤❤
@AyushiSharmaDSA
@AyushiSharmaDSA 4 дня назад
thank you, glad u liked it :)
@ozzy-fr7vj
@ozzy-fr7vj 5 дней назад
TC O(n) SC O(1) Day-Stout-Warren (DSW) algorithm Soln in Rust -> // Definition for a binary tree node. // #[derive(Debug, PartialEq, Eq)] // pub struct TreeNode { // pub val: i32, // pub left: Option<Rc<RefCell<TreeNode>>>, // pub right: Option<Rc<RefCell<TreeNode>>>, // } // // impl TreeNode { // #[inline] // pub fn new(val: i32) -> Self { // TreeNode { // val, // left: None, // right: None // } // } // } use std::{rc::Rc, cell::RefCell}; type T = Option<Rc<RefCell<TreeNode>>>; macro_rules! borrow_mut { ($option:expr) => { $option.as_ref().unwrap().borrow_mut() }; } macro_rules! borrow { ($option:expr) => { $option.as_ref().unwrap().borrow() }; } impl Solution { pub fn balance_bst(root: T) -> T { fn create_right_skewed_vine_tree(root: T) -> T { let vine_head = Some(Rc::new(RefCell::new(TreeNode::new(0)))); borrow_mut!(vine_head).right = root; let mut current = vine_head.clone(); while borrow!(current).right.is_some() { if borrow!(borrow!(current).right).left.is_some() { let right = borrow!(current).right.clone(); rotate_right(current.clone(), right); } else { current = current.unwrap().borrow().right.clone(); } } vine_head } fn get_right_skewed_vine_tree_node_count(mut root: T) -> i32 { let mut count = 0; while root.is_some() { count += 1; root = root.unwrap().borrow().right.clone(); } count } fn rotate_right(parent: T, node: T) { let temp = borrow!(node).left.clone(); borrow_mut!(node).left = borrow_mut!(temp).right.take(); borrow_mut!(temp).right = node; parent.unwrap().borrow_mut().right = temp; } fn rotate_left(parent: T, node: T) { let temp = borrow!(node).right.clone(); borrow_mut!(node).right = borrow_mut!(temp).left.take(); borrow_mut!(temp).left = node; parent.unwrap().borrow_mut().right = temp; } fn rotation_left_by_amount(mut root: T, count: i32) { for _ in 0..count { let right = borrow!(root).right.clone(); rotate_left(root.clone(), right); root = root.unwrap().borrow().right.clone(); } } //create vine let vine_head = create_right_skewed_vine_tree(root); // get total node count let nodecount = get_right_skewed_vine_tree_node_count(borrow_mut!(vine_head).right.clone()); // get node count of perfect tree let mut perfect_tree_node_count = 2_i32.pow(((nodecount + 1) as f32).log2().floor() as u32) - 1; //shift the extra nodes to the left rotation_left_by_amount(vine_head.clone(), nodecount - perfect_tree_node_count); // make rest of the tree while perfect_tree_node_count > 1 { perfect_tree_node_count /= 2; rotation_left_by_amount(vine_head.clone(), perfect_tree_node_count); } vine_head.unwrap().borrow_mut().right.take() } }
@AyushiSharmaDSA
@AyushiSharmaDSA 4 дня назад
thanks for sharing :)
@devansh6596
@devansh6596 5 дней назад
very nice explanation
@AyushiSharmaDSA
@AyushiSharmaDSA 5 дней назад
thank you :)
@sarthaksingh4146
@sarthaksingh4146 5 дней назад
It is a great explanation by the far the best, really thanks for making this hard question an easy one
@AyushiSharmaDSA
@AyushiSharmaDSA 5 дней назад
thank you, Glad you think so! :)
@rohitvhanmore8742
@rohitvhanmore8742 6 дней назад
Diff number ka xor explain nhi Kiya..like 3^4
@AyushiSharmaDSA
@AyushiSharmaDSA 6 дней назад
@@rohitvhanmore8742 it will be this 3 -> 0011 4 -> 0100 ----- 0111 So same bits - give 0 and different bits- give 1 Let me know if you understood :)
@rohitvhanmore8742
@rohitvhanmore8742 6 дней назад
@@AyushiSharmaDSA Java code kiya..toh output hi galath aata..hai
@rohitvhanmore8742
@rohitvhanmore8742 6 дней назад
@@AyushiSharmaDSA internally hexadecimal mein calculate hota hai kya..yeh xor operator
@rohitvhanmore8742
@rohitvhanmore8742 6 дней назад
Pr Mam when I do system.out.prinln(3^4) tabh yeh 7 dekata hai..output
@sarthakagarwal5673
@sarthakagarwal5673 6 дней назад
Thanks for putting in such great efforts and time for creating such in depth explanation videos it helps a lot 😀 but the java code was not really clear to me i missed somethings in it if feasible for you can you please create a short video on that part
@AyushiSharmaDSA
@AyushiSharmaDSA 4 дня назад
hi sarthak, thank you!, I will try for sure, but not sure if will be able to soon :) You can ask me here, what doubt you have in the code :)
@yukrantpatle83
@yukrantpatle83 6 дней назад
Hey 👋 Can you start Leetcode Contest discussion It will be more helpful
@AyushiSharmaDSA
@AyushiSharmaDSA 4 дня назад
hi, sure will try to do that :)
@yukrantpatle83
@yukrantpatle83 4 дня назад
@@AyushiSharmaDSA thanks 🙏
@rohitvhanmore8742
@rohitvhanmore8742 6 дней назад
apne code provide nhi kiya...🥲
@asmitshukla4649
@asmitshukla4649 6 дней назад
didi , but dp vali approach mei aapne to code dry run krwa diya. , BUT INTUITION KAHA SE MILI?? RECURSIVE CODE KAISE LIKHA?? wo sab bhi thoda bata dijiye, help hojaegi meri , please 🙏🙏
@jsr_sy
@jsr_sy 6 дней назад
Didi, can we message you for a referral for posting at Walmart?
@rishiraj2548
@rishiraj2548 6 дней назад
👍🏻👍🏻
@pmmodi3583
@pmmodi3583 6 дней назад
Dedication + Hardwork + Discipline = Ayushi
@AyushiSharmaDSA
@AyushiSharmaDSA 3 дня назад
thank you modi ji 😜😜