VALID NUMBER | LEETCODE #65 | PYTHON SOLUTION

Sdílet
Vložit
  • čas přidán 27. 06. 2022
  • In this video we are solving a classic Leetcode question and popular Facebook interview question: Valid Number (Leetcode # 65).
    This is one of those questions that isn't complicated because of it's algorithm, but difficult because of all the edge cases you need to consider and account for in your solution. Luckily there aren't that many possibilities here so we'll go through the code line by line and ensure we catch every single one!
  • Věda a technologie

Komentáře • 15

  • @user-kc9op4fl4x
    @user-kc9op4fl4x Před 7 měsíci

    Nice work.

  • @ramyhussein4091
    @ramyhussein4091 Před rokem

    You're Brilliant!

  • @Ankit-hs9nb
    @Ankit-hs9nb Před 2 lety +1

    Congrats for 1k!:)

    • @crackfaang
      @crackfaang  Před 2 lety +1

      Thanks for the continuing support!

  • @alexassali3628
    @alexassali3628 Před 2 lety +1

    Would like to thank you for being different than other channels by being reasonable in your selection of problems to benefit the listener the most without going into DP and recursive vague type of problems that he interviewers themselves cant code without cheating. I have encountered an undirected bidirectional graph where we need to find all possible paths from source to destination using dfs, the graph has possible two bidirectional links between two nodes so a node can be visited during one path search, can we see a solution or can u guide me to similar problem. thanks a lot

    • @crackfaang
      @crackfaang  Před 2 lety

      Can’t really do anything unless you provide me with a leetcode problem number. There’s too little information there to give a sensible answer without knowing the proper constraints of the problem

    • @alexassali3628
      @alexassali3628 Před 2 lety

      Dont have a number for it, however, I can send you details and even written solution, it is the site seeing problem for karat. Not sure how I can send you.

  • @AmolGautam
    @AmolGautam Před 6 měsíci

    Thank you.

  • @manojjain3501
    @manojjain3501 Před 5 měsíci

    Liked the simplicity

  • @jaybhanushali7115
    @jaybhanushali7115 Před 2 lety +1

    Thanks for the video. But The space wont be O(1) since you are slicing the string in one of your if statements!

    • @crackfaang
      @crackfaang  Před 2 lety

      Hmm yea good point. The general gist of the algorithm is the same. You can perform the integer check inline it just gets messy. I suppose even passing the index and the string itself would cause a copy to be made so you'd have to do it in place. Either way the logic is still the same. So much for writing clean code and abstracting logic away to a helper function 😂

  • @lesterdelacruz5088
    @lesterdelacruz5088 Před 4 měsíci

    "One or more digits, followed by a dot '.', followed by one or more digits." why is "4." among the list of valid numbers? It doesn't have one or more digits after the '.'

  • @vigneshsampath3256
    @vigneshsampath3256 Před 2 lety

    Now that the target (1K) is reached. Set up the new target and keep going. Never stop!

  • @schrodingerskatt222
    @schrodingerskatt222 Před 8 měsíci

    The description of this problem is so bad, seriously !!!