DEEPTI TALESRA
DEEPTI TALESRA
  • 175
  • 508 363
Dota2 Senate #leetcode #leetcode75
Explaining Dota2 Senate from leetcode in Python!
LeetCode 649
Code: github.com/deepti-talesra/LeetCode/blob/master/Dota2_Senate.py
@2:09 - Example + Explanation
@6:45 - Code
@8:52 - Code Walkthrough with Example
@12:16 - Time and Space Complexity
Music: Bensound
Lemme know if you have any comments or questions!:)))
Socials:
deeptitalesra
th-cam.com/users/deeptitalesra
Playlists:
th-cam.com/play/PL2b9acjRfGcmDEF0Piph3dDfXZdiLkk0p.html
th-cam.com/play/PL2b9acjRfGcmCOhCW1LIA2e1tvO0Gx86P.html
th-cam.com/play/PL2b9acjRfGcl-hPMbVhVtm3Nhx7o3d5my.html
th-cam.com/play/PL2b9acjRfGcl12wEB0U5MyO4EA8zO9szN.html
th-cam.com/play/PL2b9acjRfGck8msJzIqj9H3W9fLFmZ2tk.html
th-cam.com/play/PL2b9acjRfGckwHpnv_aCxU4idWcRLfoTD.html
th-cam.com/play/PL2b9acjRfGclUD8ZQPF-dyCNIeA29quSj.html
th-cam.com/play/PL2b9acjRfGckHceq_eZtt7o3me90AkgMp.html
th-cam.com/play/PL2b9acjRfGckWdp2yU_VheRcaU1EtnrMw.html
th-cam.com/play/PL2b9acjRfGcm4qYq5MH9LufsJ67-BgkAI.html
th-cam.com/play/PL2b9acjRfGcmlZY28kEJwZbvdd8BAjTMI.html
If you found this helpful, check out my channel for even **MORE VIDEOS**!!:)) th-cam.com/users/DEEPTITALESRA
Give it a shot yourself - leetcode.com/problems/dota2-senate/
มุมมอง: 202

วีดีโอ

Number of Provinces #leetcode #leetcode75 #dfs
มุมมอง 360วันที่ผ่านมา
Explaining Number of Provinces from leetcode in Python! Leetcode 547 Code: github.com/deepti-talesra/LeetCode/blob/master/Number_of_Provinces.py @1:44- Example Explanation @5:59 - Code @8:26 - Space and Time Complexity @8:53 - Code Walkthrough with Example Music: Bensound Lemme know if you have any comments or questions!:))) Socials: deeptitalesra th-cam.com/users/deeptitalesra P...
Design Add and Search Words Data Structure #leetcode #blind75
มุมมอง 306วันที่ผ่านมา
Explaining Design Add and Search Words Data Structure from leetcode in Python! Implement Trie (Prefix Tree) - th-cam.com/video/1YmGVaGb-Gc/w-d-xo.html (Watch this first if you need to!:)) ) LeetCode 211 Code: github.com/deepti-talesra/LeetCode/blob/master/Design_Add_and_Search_Words_Data_Structure.py @1:04 - Example Explanation @3:46 - Add Code @6:42 - Add Code Walkthrough with Example @7:15 - ...
Valid Sudoku #leetcode #topinterview150
มุมมอง 575วันที่ผ่านมา
Explaining Valid Sudoku from leetcode in Python! LeetCode 36 Code: github.com/deepti-talesra/LeetCode/blob/master/Valid_Sudoku.py @2:14 - Example Explanation @5:46 - Code @8:23 - Space and Time Complexity @9:12 - Code Walkthrough with Example Music: Bensound Lemme know if you have any comments or questions!:))) Socials: deeptitalesra th-cam.com/users/deeptitalesra Playlists: th-c...
Letter Combinations of a Phone Number (Iterative and Recursive!) LeetCode 17 #leetcode #leetcode75
มุมมอง 4472 วันที่ผ่านมา
Explaining Letter Combinations of a Phone Number from leetcode in Python! Code: github.com/deepti-talesra/LeetCode/blob/master/Letter_Combinations_of_a_Phone_Number.py @1:42 - Iterative Example Explanation @3:34 - Iterative Code @6:00 - Iterative Code Walkthrough with Example @8:47 - Time Complexity @9:32 - Recursive Example Explanation @12:10 - Recursive Code @15:02 - Recursive Code Walkthroug...
Asteroid Collision - LeetCode 735 - Python #leetcode #leetcode75
มุมมอง 62614 วันที่ผ่านมา
Explaining Asteroid Collision from leetcode in Python! Code: github.com/deepti-talesra/LeetCode/blob/master/Asteroid_Collision.py @1:51 - Example Explanation @4:36 - Code @8:50 - Code Walkthrough with Example @12:30 - Time Complexity Music: Bensound Lemme know if you have any comments or questions!:))) Socials: deeptitalesra th-cam.com/users/deeptitalesra Playlists: th-cam.com/pl...
Greatest Common Divisor of Strings - LeetCode 1071 #leetcode #leetcode75
มุมมอง 73414 วันที่ผ่านมา
Explaining Greatest Common Divisor of Strings from leetcode in Python! Code: github.com/deepti-talesra/LeetCode/blob/master/Greatest_Common_Divisor_of_Strings.py @1:00 - Example Explanation @3:28 - Code @6:39 - Space and Time Complexity @7:03 - Code Walkthrough with Example Music: Bensound Lemme know if you have any comments or questions!:))) Socials: deeptitalesra th-cam.com/use...
Nearest Exit from Entrance in Maze - LeetCode 1926 - Python #leetcode #leetcode75 #bfs
มุมมอง 65721 วันที่ผ่านมา
Explaining Nearest Exit from Entrance in Maze from leetcode in Python! Code: github.com/deepti-talesra/LeetCode/blob/master/Nearest_Exit_from_Entrance_in_Maze.py @2:04 - Example Explanation @4:55 - Code @9:04 - Code Walkthrough with Example Music: Bensound Lemme know if you have any comments or questions!:))) Socials: deeptitalesra th-cam.com/users/deeptitalesra Playlists: th-cam...
Online Stock Span #LeetCode901 #leetcode #leetcode75
มุมมอง 34521 วันที่ผ่านมา
Explaining Online Stock Span from leetcode in Python! Code: github.com/deepti-talesra/LeetCode/blob/master/Online_Stock_Span.py @1:24 - Example Explanation @7:12 - Code @9:08 - Code Walkthrough with Example @11:52 - Space Complexity Music: Bensound Lemme know if you have any comments or questions!:))) Socials: deeptitalesra th-cam.com/users/deeptitalesra Playlists: th-cam.com/pla...
Number of Recent Calls - LeetCode 933 #leetcode #leetcode75
มุมมอง 56828 วันที่ผ่านมา
Explaining Number of Recent Calls from leetcode in Python! Code: github.com/deepti-talesra/LeetCode/blob/master/Number_of_Recent_Calls.py @1:35 - Example Explanation @4:14 - Code @5:55- Space and Time Complexity @6:40 - Code Walkthrough with Example Music: Bensound Lemme know if you have any comments or questions!:))) Socials: deeptitalesra th-cam.com/users/deeptitalesra Playlist...
Successful Pairs of Spells and Potions - LeetCode 2300 - Python #leetcode #leetcode75
มุมมอง 326หลายเดือนก่อน
Successful Pairs of Spells and Potions from leetcode in Python! Code: github.com/deepti-talesra/LeetCode/blob/master/Successful_Pairs_of_Spells_and_Potions.py @1:52 - Example Explanation @2:49 - Time Complexity @5:17 - Code @10:00 - Code Walkthrough with Example Music: Bensound Lemme know if you have any comments or questions!:))) Socials: deeptitalesra th-cam.com/users/deeptital...
Koko Eating Bananas - LeetCode 875 #leetcode #leetcode75 #binarysearch
มุมมอง 508หลายเดือนก่อน
Explaining Koko Eating Bananas from leetcode in Python! Code: github.com/deepti-talesra/LeetCode/blob/master/Koko_Eating_Bananas.py @0:59- Example Explanation @4:10 - Code @7:01 - Code Walkthrough with Example @9:21 - Space and Time Complexity Music: Bensound Lemme know if you have any comments or questions!:))) Socials: deeptitalesra th-cam.com/users/deeptitalesra Playlists: th-...
Guess Number Higher or Lower #leetcode #leetcode75
มุมมอง 447หลายเดือนก่อน
Explaining how to solve 374. Guess Number Higher or Lower from leetcode in Python! Code: github.com/deepti-talesra/LeetCode/blob/master/Guess_Number_Higher_or_Lower.py @0:47 - Example Explanation @1:35 - Code @3:51 - Code Walkthrough with Example @5:10 - Time and Space Complexity Music: Bensound Lemme know if you have any comments or questions!:))) Socials: deeptitalesra th-cam.c...
Minimum Size Subarray Sum #leetcode #topinterview150
มุมมอง 576หลายเดือนก่อน
Explaining Minimum Size Subarray Sum from leetcode in Python! LeetCode 209 Code: github.com/deepti-talesra/LeetCode/blob/master/Minimum_Size_Subarray_Sum.py @0:57 - Example Explanation @2:51 - Code @6:36 - Code Walkthrough with Example @9:05 - Space and Time Complexity Music: Bensound Lemme know if you have any comments or questions!:))) Socials: deeptitalesra th-cam.com/users/de...
Reorder Routes to Make All Paths Lead to the City Zero #leetcode #leetcode75
มุมมอง 367หลายเดือนก่อน
Explaining Reorder Routes to Make All Paths Lead to the City Zero from leetcode in Python! LeetCode 1466 Code: github.com/deepti-talesra/LeetCode/blob/master/Reorder_Routes_to_Make_All_Paths_Lead_to_the_City_Zero.py @1:49 - Example Explanation @3:58 - Code @8:38 - Space and Time Complexity @9:01 - Code Walkthrough with Example Music: Bensound Lemme know if you have any comments or questions!:))...
Word Pattern #leetcode #topinterview150
มุมมอง 598หลายเดือนก่อน
Word Pattern #leetcode #topinterview150
Search Insert Position #leetcode #binarysearch #topinterview150
มุมมอง 533หลายเดือนก่อน
Search Insert Position #leetcode #binarysearch #topinterview150
Find the Difference of Two Arrays - LeetCode 2215 - Python #leetcode #leetcode75
มุมมอง 460หลายเดือนก่อน
Find the Difference of Two Arrays - LeetCode 2215 - Python #leetcode #leetcode75
Isomorphic Strings #leetcode #topinterview150
มุมมอง 448หลายเดือนก่อน
Isomorphic Strings #leetcode #topinterview150
Sum Root to Leaf Numbers #leetcode #topinterview150
มุมมอง 388หลายเดือนก่อน
Sum Root to Leaf Numbers #leetcode #topinterview150
Average of Levels in Binary Tree #leetcode #topinterview150 #binarytree
มุมมอง 415หลายเดือนก่อน
Average of Levels in Binary Tree #leetcode #topinterview150 #binarytree
Find the Index of the First Occurrence in a String #leetcode #topinterview150 #binarytree
มุมมอง 8912 หลายเดือนก่อน
Find the Index of the First Occurrence in a String #leetcode #topinterview150 #binarytree
Longest Consecutive Sequence #leetcode #blind75
มุมมอง 8902 หลายเดือนก่อน
Longest Consecutive Sequence #leetcode #blind75
Max Consecutive Ones III #leetcode #leetcode75
มุมมอง 8302 หลายเดือนก่อน
Max Consecutive Ones III #leetcode #leetcode75
Removing Stars From a String - LeetCode 2390 - Python #leetcode75 #stack #leetcode
มุมมอง 1.4K2 หลายเดือนก่อน
Removing Stars From a String - LeetCode 2390 - Python #leetcode75 #stack #leetcode
Minimum Number of Arrows to Burst Balloons - LeetCode 452 - Python #leetcode #leetcode75 #greedy
มุมมอง 7332 หลายเดือนก่อน
Minimum Number of Arrows to Burst Balloons - LeetCode 452 - Python #leetcode #leetcode75 #greedy
Reverse Words in a String - LeetCode 151 - Python #leetcode75
มุมมอง 1.5K2 หลายเดือนก่อน
Reverse Words in a String - LeetCode 151 - Python #leetcode75
Maximum Twin Sum of a Linked List - LeetCode 2130 - Python #leetcode75
มุมมอง 5732 หลายเดือนก่อน
Maximum Twin Sum of a Linked List - LeetCode 2130 - Python #leetcode75
String Compression - LeetCode 443 - Python #leetcode75 #leetcode
มุมมอง 1.8K2 หลายเดือนก่อน
String Compression - LeetCode 443 - Python #leetcode75 #leetcode
Merge k Sorted Lists - LeetCode 23 - Python #heap #leetcode #linkedlist
มุมมอง 6252 หลายเดือนก่อน
Merge k Sorted Lists - LeetCode 23 - Python #heap #leetcode #linkedlist

ความคิดเห็น

  • @deepakjyoti8355
    @deepakjyoti8355 วันที่ผ่านมา

    Blessing to watch your videos. Keep going ....

  • @manishshetty5358
    @manishshetty5358 วันที่ผ่านมา

    The best video explanation for this problem is this video right here , trust me when i say that I've looked for other videos for this problem and this is the best !! Thank you

  • @alessandrog498
    @alessandrog498 2 วันที่ผ่านมา

    Probably the best there is when it comes to explaining this stuff

  • @canadaVaasi
    @canadaVaasi 2 วันที่ผ่านมา

    Thank you for keep posting problem solving videos! It helps a lot. 2 days back Ive searched for this problem.

  • @sandeeplokhande7010
    @sandeeplokhande7010 2 วันที่ผ่านมา

    but we have used list(string) and the question states use constant extra space .ain't that a violation

  • @deepakjyoti8355
    @deepakjyoti8355 3 วันที่ผ่านมา

    Can't stop loving your videos.

  • @BesmarrtKaifAnsari
    @BesmarrtKaifAnsari 3 วันที่ผ่านมา

    Great explanation❤❤thank you very much for making videos like this.... Please don't stop this i am learning a lot from your videos

  • @BesmarrtKaifAnsari
    @BesmarrtKaifAnsari 3 วันที่ผ่านมา

    Great explanation please continue this series❤❤

  • @petersmith8488
    @petersmith8488 4 วันที่ผ่านมา

    one of the best explanation , without getting bored i watched this video.

    • @LWMDevelopers
      @LWMDevelopers 3 วันที่ผ่านมา

      bhai sharam ni aa rhi juth bol ke

  • @albertohuerta
    @albertohuerta 4 วันที่ผ่านมา

    See there needs to be a pointer manipulation tag in leetcode. I had such a hard time visualizing O(1) memory. Great vid!

  • @codingcardio-nq7uc
    @codingcardio-nq7uc 4 วันที่ผ่านมา

    thankyou for sharing , even though i had woorked upon the solution was stuck with edge cases

  • @tranchithanh7206
    @tranchithanh7206 6 วันที่ผ่านมา

    Easy money i've ever made => return a+b 🐱‍🏍🐱‍🏍

  • @jst8922
    @jst8922 7 วันที่ผ่านมา

    3:47 what does last down right {s:S} mean ? If we a re talking about binary boolean, there should be only True (T) of False (F). in this case T for word "ts".

  • @keyzuniverse
    @keyzuniverse 7 วันที่ผ่านมา

    Your my hero, every time i stack i search for your tutorials direct, the way you can explain the problem in the leetcode IDE helps me a lot durign interviews

  • @nelsonbeneche2372
    @nelsonbeneche2372 7 วันที่ผ่านมา

    Hi

  • @deepakjyoti8355
    @deepakjyoti8355 8 วันที่ผ่านมา

    You are an inspiration Deepti

  • @deepakjyoti8355
    @deepakjyoti8355 8 วันที่ผ่านมา

    Super Quality Videos Deepti .

  • @pravargupta6285
    @pravargupta6285 8 วันที่ผ่านมา

    Under rated gem. Didnot expect such quality after seeing the subs count. Keep it up!

  • @benji-t7v
    @benji-t7v 8 วันที่ผ่านมา

    Your videos are gold. Thank you

  • @Varunkrsk
    @Varunkrsk 10 วันที่ผ่านมา

    thenks for the lecture misss it was really helpful!

  • @PhantumKai
    @PhantumKai 11 วันที่ผ่านมา

    Happy New Year! I really appreciate your content and you doing examples after writing out the code. Has helped my confidence out a lot!

  • @markelmorehome
    @markelmorehome 11 วันที่ผ่านมา

    clever solution. clear explanation. I don't think you need to slow down at all!

  • @kevinalejandromendezsantan2813
    @kevinalejandromendezsantan2813 11 วันที่ผ่านมา

    Nice approach! You did it easily and I could enhance my code with your explanation! Thank you 💚

  • @jamirwalker1771
    @jamirwalker1771 12 วันที่ผ่านมา

    Bravo this walkthrough was great!

  • @kevinalejandromendezsantan2813
    @kevinalejandromendezsantan2813 13 วันที่ผ่านมา

    Thank you for the explanation it was so clear! It is a great solution and It is too short i wrote more lines of code before I saw this video

  • @deepakjyoti8355
    @deepakjyoti8355 13 วันที่ผ่านมา

    Simply wow.

  • @FRAMEDSKATEKREW69
    @FRAMEDSKATEKREW69 14 วันที่ผ่านมา

    insane answer for this question, I've been locking in and watching multiple videos to find the best way and easiest answer to remember. Thanks to this video you taught me a new method in python.

  • @flatmapper
    @flatmapper 14 วันที่ผ่านมา

    Хелло

  • @moajezlalani9204
    @moajezlalani9204 15 วันที่ผ่านมา

    nice explanation

  • @deepakjyoti8355
    @deepakjyoti8355 17 วันที่ผ่านมา

    Can I make money in stocks using your Algo ?

  • @deepakjyoti8355
    @deepakjyoti8355 17 วันที่ผ่านมา

    Are you the star in the asteroidCollision func ?

  • @deepakjyoti8355
    @deepakjyoti8355 17 วันที่ผ่านมา

    Elegant Deepti with eloquent solution.

  • @deepakjyoti8355
    @deepakjyoti8355 17 วันที่ผ่านมา

    Vivacious girl Merry Christmas to you !

  • @deepakjyoti8355
    @deepakjyoti8355 17 วันที่ผ่านมา

    Amazing Dear Deepti. Salute to your passion.

  • @veotic2728
    @veotic2728 17 วันที่ผ่านมา

    This should honestly be a medium leetcode question😭

  • @Alan-bu2hi
    @Alan-bu2hi 17 วันที่ผ่านมา

    Thanks again for these fire content. During an interview setting would dry running / or stepping through it the way you’re demonstrating be good? I’m trying to iron out how to approach interviews

  • @jst8922
    @jst8922 17 วันที่ผ่านมา

    comments with code class Solution: def asteroidCollision(self, asteroids: List[int]) -> List[int]: # Initialize empty stack to store asteroids stack = [] # Iterate through each asteroid in the input array for ast in asteroids: # Enter while loop when: # 1. stack is not empty AND # 2. top asteroid is moving right (positive) AND # 3. current asteroid is moving left (negative) while stack and stack[-1] > 0 and ast < 0: # Get the last asteroid from stack last = stack.pop() # If last asteroid is bigger, it survives # Current asteroid is destroyed if last > - ast: stack.append(last) break # If both asteroids are equal in size # Both asteroids are destroyed elif last == -ast: break # If last asteroid is smaller # It gets destroyed and loop continues # to check against next asteroid in stack # This else clause executes when: # 1. Stack is empty OR # 2. No collision occurred OR # 3. Current asteroid destroyed all asteroids it collided with else: stack.append(ast) # Return final state of asteroids return stack

    • @jst8922
      @jst8922 17 วันที่ผ่านมา

      on both lines if last > - ast: and elif last == -ast: one can use python build in abs() function -> if last > abs(ast): elif last == abs(ast): although is then code 4ms slower.

  • @ishananaguru
    @ishananaguru 17 วันที่ผ่านมา

    Happy New Year! Thanks for the content!

  • @ashishkulkarni2350
    @ashishkulkarni2350 17 วันที่ผ่านมา

    Happy new year deepti.. hope this year with your videos i land a FAANG job🤪😅

  • @johnpulawski35
    @johnpulawski35 18 วันที่ผ่านมา

    you said o(1) but at 8:27 you pop off two elements? still o(1)? Doesnt that mean it can be o(n)? thanks 👍

  • @SabinSipai
    @SabinSipai 19 วันที่ผ่านมา

    thank you deepti

  • @dangtin277
    @dangtin277 20 วันที่ผ่านมา

    you can write a gcd function to beat 100%

  • @veotic2728
    @veotic2728 20 วันที่ผ่านมา

    Such a crazy thing that you uploaded when I needed this the most😭

    • @PhantumKai
      @PhantumKai 20 วันที่ผ่านมา

      same!! i was literally working on this problem yesterday

  • @jst8922
    @jst8922 20 วันที่ผ่านมา

    Very elegant solution indeed ! Here is one without using "math.gcd" (not sure which one is faster), edit: your solution uses Python's built-in math.gcd which is implemented in C and is highly optimized, while loop is slower. class Solution: def gcdOfStrings(self, str1: str, str2: str) -> str: # Helper function to compute GCD of two numbers def compute_gcd(a: int, b: int) -> int: while b != 0: a, b = b, a % b return a # 1. Check compatibility if str1 + str2 != str2 + str1: return "" # 2. Compute GCD of lengths gcd_length = compute_gcd(len(str1), len(str2)) # 3. Extract the candidate string candidate = str1[:gcd_length] # 4. Verify the candidate if (str1 == candidate * (len(str1) // gcd_length)) and \ (str2 == candidate * (len(str2) // gcd_length)): return candidate else: return "" Recursive solution with "if" instead of "while" loop: class Solution: def gcdOfStrings(self, str1: str, str2: str) -> str: # Recursive function to compute GCD of two numbers def compute_gcd(a: int, b: int) -> int: if b == 0: return a return compute_gcd(b, a % b) # 1. Check compatibility if str1 + str2 != str2 + str1: return "" # 2. Compute GCD of lengths gcd_length = compute_gcd(len(str1), len(str2)) # 3. Extract the candidate string candidate = str1[:gcd_length] # 4. Verify the candidate if (str1 == candidate * (len(str1) // gcd_length)) and \ (str2 == candidate * (len(str2) // gcd_length)): return candidate else: return ""

    • @jst8922
      @jst8922 20 วันที่ผ่านมา

      btw, if someone doesn't have lc premium account to use debugger, add "import math" and use PyCharm community edition, Visual Studio Code or anything similar with IDE with debugger like this: import math class Solution: def gcdOfStrings(self, str1: str, str2: str) -> str: if str1 + str2 != str2 + str1: return "" size = math.gcd(len(str1), len(str2)) return str1[:size] solution = Solution() print(solution.gcdOfStrings("ABCABC", "ABC")) # Output: "ABC" print(solution.gcdOfStrings("ABABAB", "ABAB")) # Output: "AB" print(solution.gcdOfStrings("LEET", "CODE")) # Output: ""

  • @BananaButcher
    @BananaButcher 21 วันที่ผ่านมา

    Great explanation, thanks.

  • @rojo_pes75
    @rojo_pes75 23 วันที่ผ่านมา

    Awesome clear explanation 💪

  • @joniabeje5365
    @joniabeje5365 23 วันที่ผ่านมา

    Merry Christmas Deepthi! Been learning from you for a while, your explanation through examples really help me understand things. Thank you so much for your help and happy holidays!

  • @sukhvirkaur7022
    @sukhvirkaur7022 25 วันที่ผ่านมา

    Hey there, How can we convert this number 3682 to Roman numbers? I am confused about how we will convert the number 6 to a Roman number according to your code.

  • @aditya9896
    @aditya9896 25 วันที่ผ่านมา

    Found this at the perfect time!Thanks, your explanation helped me to realise why BS can give optimal solution. Merry Christmas 💖 and Happy Holidays ⛄

  • @Rohit_ashva
    @Rohit_ashva 26 วันที่ผ่านมา

    Winter is coming !