Rotting Oranges | LeetCode 994 | C++, Java, Python

Sdílet
Vložit
  • čas přidán 6. 09. 2024
  • LeetCode Solutions: • LeetCode Solutions | L...
    August LeetCoding Challenge: • Playlist
    Github Link: github.com/Kno...
    *** Best Books For Data Structures & Algorithms for Interviews:*********
    1. Cracking the Coding Interview: amzn.to/2WeO3eO
    2. Cracking the Coding Interview Paperback: amzn.to/3aSSe3Q
    3. Coding Interview Questions - Narasimha Karumanchi: amzn.to/3cYqjkV
    4. Data Structures and Algorithms Made Easy - N. Karumanchi: amzn.to/2U8FrDt
    5. Data Structures & Algorithms made Easy in Java - N. Karumanchi: amzn.to/2U0qZgY
    6. Introduction to Algorithms - CLR - Cormen, Leiserson, Rivest: amzn.to/2Wdp8rZ
    *****************************************************************************
    August LeetCoding Challenge | Problem 9 | Rotting Oranges | 9 August,
    Facebook Coding Interview question,
    google coding interview question,
    leetcode,
    Rotting Oranges,
    Rotting Oranges c++,
    Rotting Oranges Java,
    Rotting Oranges python,
    Rotting Oranges solution,
    994. Rotting Oranges,
    #CodingInterview #LeetCode #AugustCodingChallenge #Google #Amazon #graphtheory #bfs

Komentáře • 43

  • @borat_trades2860
    @borat_trades2860 Před 4 lety +4

    i like watching it daily, hi from Kazakhstan to India!

  • @udbhasdutta3499
    @udbhasdutta3499 Před rokem +1

    Beautiful explanation. Thanks for the lesson!

  • @shreyasipaul7767
    @shreyasipaul7767 Před 3 lety +1

    Nothing could be more helpful than this....thank u so much for such precious content 💕

  • @jimwoodward7293
    @jimwoodward7293 Před 4 lety +1

    Impressive how you go from cpp to java to python. Thanks for the daily lessons!

    • @KnowledgeCenter
      @KnowledgeCenter  Před 4 lety

      I have worked at 5 companies, have coded in all languages, though C++ is my primary language.

    • @jimwoodward7293
      @jimwoodward7293 Před 4 lety +1

      @@KnowledgeCenter Very nice -- Python is my primary language; I coded in C++ years ago. Thanks again!

  • @cannpl10
    @cannpl10 Před 3 lety +1

    BEST SOLUTION TO THIS PROBLEM!!! LOVE THIS CHANNEL !!!

  • @virinchimsk83
    @virinchimsk83 Před 4 lety +3

    I think This is the only channel explains solution in c++,java, python🔥🔥🙏thank you so much sir🙏🙏🙏

  • @shree1365
    @shree1365 Před 4 lety

    Given an array of integer A and an integer K find number to hppy element.
    Element x is happy if there exist at least 1 element who's defference is less then K i.e an element is happy.if there is another element int the range[x-k,x+k] other then x it's selft.
    Constraints:
    1

  • @VenkatIyer
    @VenkatIyer Před 3 lety +1

    Since, we are iterating over the matrix cordinates, wouldn't the complexity be O(r x c)? Is it right to say it is O(n)?

    • @KnowledgeCenter
      @KnowledgeCenter  Před 3 lety

      Correct. I just defined n = r x c (number of cells in matrix).

  • @aviknayak1608
    @aviknayak1608 Před rokem

    what if rotten orange is not at starting position but at end too?

  • @sandeshrana7225
    @sandeshrana7225 Před 3 lety +1

    Thanks

  • @shivanktripathi4661
    @shivanktripathi4661 Před 4 lety +1

    How would you apply a loop from(0,3) instead of writting the whole thing four times !!!

    • @KnowledgeCenter
      @KnowledgeCenter  Před 4 lety +1

      You can have 4 directions corresponding to row and column.
      dr = {0, 0, 1, -1}, dc = {1, -1, 0, 0}
      for(i = 0 to 3){
      grid [ x+dr[i] ] [ y + dc[i] ] ----- check bound + condition and update
      }

  • @emmanuellopez1960
    @emmanuellopez1960 Před 4 lety +1

    Really good content, kudos from a daily viewer.

  • @manpreetkhokhar5318
    @manpreetkhokhar5318 Před 4 lety +2

    Thanks for the solution. You have been very consistent with quality of the video content. Although,I am not participating in August LeetCoding Challenge but still see some of the good problems and your videos.

  • @raviashwin1157
    @raviashwin1157 Před 4 lety

    Sir the problem which can be solved by bfs,can also be solved by dfs? and vice versa.......is it good to know both the logics....Sir i find bfs to be more intuitive than dfs

  • @Singhyogendra13
    @Singhyogendra13 Před 4 lety

    Why can't we we use DFS here ? and how can we check the problem is for DFS or BFS?

  • @lokeshsenthilkumar4522
    @lokeshsenthilkumar4522 Před 3 lety +1

    1080p video is scrambled

    • @KnowledgeCenter
      @KnowledgeCenter  Před 3 lety

      Not sure if its specific to you. Anybody else facing it?

  • @suchitragiri4546
    @suchitragiri4546 Před 4 lety +1

    Your consistency to make content thereafter upload the video daily inspired me a lot!
    helpful:)

  • @ijaz2020
    @ijaz2020 Před 4 lety +1

    Bestuu..

  • @apk9215
    @apk9215 Před 3 lety

    Is it possible to write this program in c language ??

  • @RvSingh-yo6gi
    @RvSingh-yo6gi Před 4 lety +1

    Thank you for sharing knowledge consistent to watch your content....awesome

  • @borat_trades2860
    @borat_trades2860 Před 4 lety +2

    i think i need to solve all the 1400 problems before trying any interview... to be sure i pass..

  • @shree1365
    @shree1365 Před 4 lety

    Sir today I face one program can u please explain .. count pairs program

  • @shree1365
    @shree1365 Před 4 lety

    Sir please jo mene program diya h usko solve krke video bnaye na sir please