Rotting Oranges | LeetCode 994 | C++, Java, Python
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
i like watching it daily, hi from Kazakhstan to India!
Hello from India.
Beautiful explanation. Thanks for the lesson!
Glad it was helpful!
Nothing could be more helpful than this....thank u so much for such precious content 💕
Thanks. Glad to hear.
Impressive how you go from cpp to java to python. Thanks for the daily lessons!
I have worked at 5 companies, have coded in all languages, though C++ is my primary language.
@@KnowledgeCenter Very nice -- Python is my primary language; I coded in C++ years ago. Thanks again!
BEST SOLUTION TO THIS PROBLEM!!! LOVE THIS CHANNEL !!!
Glad to hear that.
I think This is the only channel explains solution in c++,java, python🔥🔥🙏thank you so much sir🙏🙏🙏
Thanks and welcome
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
This problem
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)?
Correct. I just defined n = r x c (number of cells in matrix).
what if rotten orange is not at starting position but at end too?
Thanks
No problem
How would you apply a loop from(0,3) instead of writting the whole thing four times !!!
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
}
Really good content, kudos from a daily viewer.
Much appreciated!
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.
Thanks.
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
Why can't we we use DFS here ? and how can we check the problem is for DFS or BFS?
1080p video is scrambled
Not sure if its specific to you. Anybody else facing it?
Your consistency to make content thereafter upload the video daily inspired me a lot!
helpful:)
Happy to hear that!
Bestuu..
Is it possible to write this program in c language ??
Thank you for sharing knowledge consistent to watch your content....awesome
i think i need to solve all the 1400 problems before trying any interview... to be sure i pass..
It will take years to complete
Sir today I face one program can u please explain .. count pairs program
Sir please jo mene program diya h usko solve krke video bnaye na sir please