Leetcode 458 Poor Pigs | Checkout Coding Decoded SDE preparation Sheet link below

Here is the solution to "Poor Pigs" leetcode question. Hope you have a great time going through it.
🎉Question : leetcode.com/problems/poor-pigs/
🔥 𝕊𝕦𝕓𝕤𝕔𝕣𝕚𝕓𝕖𝕣 𝕨𝕚𝕥𝕙 𝟡 𝕠𝕗𝕗𝕖𝕣𝕤 𝕥𝕙𝕒𝕥 𝕣𝕖𝕛𝕖𝕔𝕥𝕖𝕕 𝔾𝕠𝕠𝕘𝕝𝕖 𝕃𝟞: • 9 Offers One Subscribe...
Check this out 🔽🔽🔽🔽
🔴 Coding Decoded SDE revision Sheet: bit.ly/3MG7d4D
🔥 Coding Decoded Binary Search TreeMap revision Sheet: bit.ly/3kUsiMa
🔥 Coding Decoded Trie revision Sheet: bit.ly/392YOJH
🔥 Coding Decoded Graph SDE sheet: bit.ly/3sfp8H4
🔥 Coding Decoded Stacks/Monotonic Stacks sheet: bit.ly/38tm0Ri
🔥 Coding Decoded Bit Manipulation sheet:bit.ly/3LkVNSe
🔥 Coding Decoded Backtracking SDE sheet: bit.ly/3FCzMwQ
🔥 Coding Decoded DP SDE sheet: bit.ly/38HgY3E
🔥 Coding Decoded Heaps SDE Sheet: bit.ly/3GQqBK7
🔥 Coding Decoded Maps/Sets SDE Sheet: bit.ly/3xfBemu
🔥 Coding Decoded Two Pointer SDE Sheet: bit.ly/3trJCwX
🔴 Connect with me here:
🔅My Linkedin(Sunchit Dudeja): bit.ly/3Qnk0L0
🔅Don't click: bit.ly/32XIXbU
🔅Insta: bit.ly/31TV5ur
🔅 Twitter: / sunchitdudeja
🔅Telegram Link for Chrome: telegram.me/codingdecoded
🔅Telegram Link for phone : t.me/codingdecoded
🔥🔥🔥🔥👇👇👇 For discussion/feedback/humour/doubts/new openings
Feel free to join discord / discord
👉 Solutions
Java➡️github.com/Sunchit/Coding-Dec...
🔥🔥🔥🔥👇👇👇 For discussion/feedback/humour/doubts/new openings
Feel free to join discord / discord
🔴 Checkout the series: 🔥🔥🔥
👉 Leetcode Interview experiences and tips : • Playlist
👉 Leetcode contests: www.youtube.com?list=PLEI-q7w3s9gRwAEYzYkvVTsYHDi2-ffdL
👉 Leetcode System Design: • System Design
👉 Leetcode LinkedList: • Coding Decoded LinkedL...
👉 Leetcode Stack: • Coding Decoded Stack S...
👉 Leetcode Binary Search: • Coding Decoded BinaryS...
👉 Leetcode Tree: • Coding Decoded Tree Se...
👉 Leetcode Dyanmic Programming: • Coding Decoded Dynamic...
👉 Leetcode Hard: • LeetCode Hard Problems
👉 Leetcode Heap: • Coding Decoded Heap Se...
👉 Building Coding Aptitude: • Building Coding Aptitude
👉 Leetcode Map: • Coding Decoded Map Ser...
👉 Leetcode Two Pointer: • Coding Decoded Two Poi...
👉 Leetcode Backtracking: • Leetcode Backtracking ...
👉 Leetcode Graph Traversal: • Coding Decoded Graph T...
👉 Leetcode Trie: • Coding Decoded Trie Se...
👉 Leetcode Union Find: • Coding Decoded Union F...
👉 Leetcode BFS Graph Problems: • Coding Decoded BFS Ser...
👉 Leetcode Matrix Problems: • Coding Decoded Matrix ...
👉 Leetcode Easy: • Leetcode Easy Problems
👉 Leetcode Bit Manipulation: • Coding Decoded Bit Man...
🔥🔥🔥 Leetcode Monthly Contest Playlist
👉 Leetcode December 2021: www.youtube.com?list=PLEI-q7w3s9gRN3LsF0zArurVSz3HQyKZP
👉 Leetcode November 2021: www.youtube.com?list=PLEI-q7w3s9gT2IeinxSocuxyOKMB4H2zF
👉 Leetcode October 2021: www.youtube.com?list=PLEI-q7w3s9gTNU412xW8kV1xQ8upnrN0a
👉 Leetcode September 2021: www.youtube.com?list=PLEI-q7w3s9gTNU412xW8kV1xQ8upnrN0a
👉 Leetcode August2021: www.youtube.com?list=PLEI-q7w3s9gTEQxR2uR-g8DVhSTb2ZAx1
👉 Leetcode July 2021: www.youtube.com?list=PLEI-q7w3s9gRV3Bn3VO1rtgkA0wNkIm-y
👉 Leetcode June 2021: www.youtube.com?list=PLEI-q7w3s9gRGYr0jtVjqir5_8SpnQ6Og
👉 Leetcode May 2021: www.youtube.com?list=PLEI-q7w3s9gS8UNo22UA4O3_YjnQczyNp
👉 Leetcode April 2021: www.youtube.com?list=PLEI-q7w3s9gStjIegCW3i84AI9L2KjGhJ

Пікірлер: 24

  • @42basavarajangadi56
    @42basavarajangadi568 ай бұрын

    how can we get such an idea for the first time😅😅

  • @nands4410
    @nands4410 Жыл бұрын

    get well soon sir

  • @krateskim4169
    @krateskim4169 Жыл бұрын

    take care and get well soon

  • @levi-07
    @levi-07 Жыл бұрын

    Get well soon Sir🙏

  • @adithibhat7277
    @adithibhat7277 Жыл бұрын

    Take care! Get well soon

  • @Mr_SSK
    @Mr_SSK Жыл бұрын

    The presentation was very good! Thank you so much for explaining the concept in such easy manner... Get well soon!

  • @CodeWithSunchitDudeja

    @CodeWithSunchitDudeja

    Жыл бұрын

    Thanks a lot 😊

  • @santoshvarma996
    @santoshvarma996 Жыл бұрын

    get well soon

  • @suheabkhan2546
    @suheabkhan2546 Жыл бұрын

    take care bro!!! your videos are very helpful... yours is the only consistent channel!! thanks for your efforts

  • @CodeWithSunchitDudeja

    @CodeWithSunchitDudeja

    Жыл бұрын

    So nice of you

  • @sarankumar165
    @sarankumar165 Жыл бұрын

    Get well soon..! Thanks for the awesome explanation👏

  • @CodeWithSunchitDudeja

    @CodeWithSunchitDudeja

    Жыл бұрын

    So nice of you

  • @abhishekvishwakarma9045
    @abhishekvishwakarma9045 Жыл бұрын

    you're doing awesome job get well soon💪

  • @CodeWithSunchitDudeja

    @CodeWithSunchitDudeja

    Жыл бұрын

    Thank you!

  • @wintersol9921
    @wintersol9921 Жыл бұрын

    First of all get well soon. And thank you for the solution. I have a question about the interviews in general. I would be happy if you could answer them. My first question is that: I heard that it is not advised to use global variables in the interviews, it may cause you to get rejected just because of using global variables. Is that true? My second question: Is it okay to use more than 1 helper function in an interview question. For example: I have a recursive function, and in that function I put all the characters of a string into a hashmap, is it better to create a function that puts the characters into the hashmap, or should I put it inside the recursive function rather than writing another function?

  • @avinashjaiswal4762

    @avinashjaiswal4762

    Жыл бұрын

    Don't use the global variable because there are many scenario's where value store in the global variable. It cause the issue for other request. I waste hours while debugging the API because one colleague use the global variable in the api due to that API was giving wrong data.

  • @nicolattu
    @nicolattu8 ай бұрын

    I did it today, but I thought the the number of time intervals were just a factor of number of pigs. Still not sure with it's a power.

  • @39_jatinjain4
    @39_jatinjain48 ай бұрын

    what a code if(buckets-- ==1) return 0; how??

  • @pranavsharma7479
    @pranavsharma7479 Жыл бұрын

    bro in the 2d matrix figure how can a pig p1 dring all column buckets while p2,p3,p4,p5 are still drinking it, it said in the ques that , You may not feed any other pigs during this time. i am confused now

  • @aishwariyaaish8305

    @aishwariyaaish8305

    Жыл бұрын

    since this constraint is given in the question: *The pig will consume all the chosen buckets simultaneously and will take no time.* implies the same pig can drink 0th, 5th, 10th 15th 20th bucket simultaneously in the first 15 mins after 15 mins the same pig drink 1st,6th,11th,16th,20th in general the same pig can drink 1st column's all the row bucket simultaneously, *Author explanation is misleading.* we need just 2 pigs to test 25 buckets 1 pig for row wise and other pig for column wise

  • @user-mg6oo2ji3g
    @user-mg6oo2ji3g4 ай бұрын

    Could you transverse for 5 dimensional??? 😂😂.... You explained till 3 dimensional.. Give same example for 4 dimensional and 5 dimensional...

  • @user-og4np7pe7w
    @user-og4np7pe7w8 ай бұрын

    This is an incorrect solution. It will fail some of the test cases. Though even I am trying to figure out what I am doing wrong. Will post it here

  • @user-og4np7pe7w

    @user-og4np7pe7w

    8 ай бұрын

    Important thing guys we need to use base 10 for all log operations instead of default base e.