#Leetcode

  Рет қаралды 11,583

Code with Alisha

Code with Alisha

Күн бұрын

Пікірлер: 40
@RAHULYADAV-zr5fq
@RAHULYADAV-zr5fq 2 жыл бұрын
this is the explanation I was looking for !!. thanks, Beauty with brain!!.
@adil_k
@adil_k 11 ай бұрын
Hey Alisha... great explanation. Thanks for the video. I appreciate your effort.
@ashok2089
@ashok2089 4 ай бұрын
Amazing walkthrough on DFS through matrix! Thanks!
@pankajkumarray6716
@pankajkumarray6716 3 жыл бұрын
You have put lot of efforts, thanks for explaining. Helpful.
@ahmedanwer6899
@ahmedanwer6899 Жыл бұрын
thanks for going deep with the depth first search traversal
@sarankumaar6009
@sarankumaar6009 2 жыл бұрын
your videos are gem no matter wat other video give.
@gitanjalikumari9262
@gitanjalikumari9262 2 жыл бұрын
This is one of the best explanation for this problem.. thank you😊
@yynnooot
@yynnooot 2 жыл бұрын
Thank you for the step-by-step explanation!
@gurgaon_videos
@gurgaon_videos 3 ай бұрын
One correction - In line 22 you should change row( 2nd paramater) to matrix.size() -1 and column(third parameter) of fnc to i since we are traversing on the last row of grid.
@redlatming2136
@redlatming2136 3 жыл бұрын
This explanation was amazing! Been searching for a long time. Thanks!
@tarunmali6228
@tarunmali6228 2 жыл бұрын
Hi Ma'am, you definitely make the best leetcode solutions!!! Your channel deserves more subscribers!! Your channel will boom one day similar to Nick White
@smartswaggy6114
@smartswaggy6114 2 жыл бұрын
Fantastic video Alisha mam. I love the way you explain and handle the unprecedented situation like laptop hanging. This qn is quite easy to do but explaining it to others is a difficult task. You nailed it in explanation. I have become your fan :)
@probabilitycodingisfunis1
@probabilitycodingisfunis1 2 жыл бұрын
Thanks @smartswaggy ...this means a lot!
@shivamkeshri
@shivamkeshri 5 ай бұрын
Can you discuss about the complexity as well??
@maddycoder1294
@maddycoder1294 2 жыл бұрын
nice explaination di
@utkarshkanungo5092
@utkarshkanungo5092 2 жыл бұрын
wow thanks.... 32:34 struggle is real
@Daksh-dz7hk
@Daksh-dz7hk 4 ай бұрын
Best video 💪
@pankajgoel3689
@pankajgoel3689 2 жыл бұрын
amazing step by step explaination
@adhed_engineer
@adhed_engineer 2 жыл бұрын
great stuff
@II-ii2um
@II-ii2um 3 жыл бұрын
Welcome back :)
@reshmaparveen6679
@reshmaparveen6679 3 жыл бұрын
Great explanation ❤️
@sundeepkumar3871
@sundeepkumar3871 2 жыл бұрын
great explanation
@shubhamkale5003
@shubhamkale5003 2 жыл бұрын
Vary well explained
@gauravsharma1251
@gauravsharma1251 2 жыл бұрын
great
@lalitagarwal9155
@lalitagarwal9155 Жыл бұрын
// SIMPLE C++ USING BFS 99.64% faster class Solution { public: int rows,columns; vectormovements{{1,0},{-1,0},{0,1},{0,-1}}; bool isValid(int r,int c){ return r>=0 and r=0 and c=heights[r][c] and sea[nr][nc]!=1){ q.push({nr,nc}); } } } } vector pacificAtlantic(vector& heights) { rows=heights.size(),columns=heights[0].size(); queueq1,q2; vectorres,pacific(rows,vector(columns,0)),atlantic(rows,vector(columns,0)); for(int i=0;i
@codeculture2
@codeculture2 3 жыл бұрын
great explanation! thanks a lot.
@sahiltest7309
@sahiltest7309 2 жыл бұрын
i just don t know how you guys think these things
@onkar1108
@onkar1108 2 жыл бұрын
Great explanation !! Watching your explanations, the way you approach the problem matches with my thinking, so I love to watch your explanations. I can relate to the approach unlike other explanations on YT. Kudos to you. Definitely your channel is under valued but surely its gonna boom in the near future.
@probabilitycodingisfunis1
@probabilitycodingisfunis1 2 жыл бұрын
Thank you so much Onkar!
@SlokAks
@SlokAks 2 жыл бұрын
Same questions mentioning RED and BLUE lakes in interviewbit... BFS solution to above approach.. #define RED 1 #define BLUE 0 vector dx = {1, -1, 0, 0}; vector dy = {0, 0, 1, -1}; int m, n; vector visA, visB; bool isValid(int i, int j) { return i >= 0 && j >= 0 && i < m && j < n; } void bfs(vector &A, int i, int j, bool lake) { vector &vis = (lake == BLUE ? visA : visB); queue q; q.push({i, j}); int x, y; while(!q.empty()) { tie(i, j) = q.front(); q.pop(); if(vis[i][j]) continue; vis[i][j] = 1; for(int k = 0; k < 4; k++) { x = i + dx[k]; y = j + dy[k]; if(isValid(x, y) && A[x][y] >= A[i][j]) { q.push({x, y}); } } } } int Solution::solve(vector &A) { m = A.size(), n = A[0].size(); int ans = 0; visA = visB = vector (m, vector (n, 0)); for(int j = 0; j < n; j++) { bfs(A, 0, j, BLUE); bfs(A, m-1, j, RED); } for(int i = 0; i < m; i++) { bfs(A, i, 0, BLUE); bfs(A, i, n-1, RED); } for(int i = 0; i < m; i++) { for(int j = 0; j < n; j++) { if(visA[i][j] && visB[i][j]) { ans++; } } } return ans; }
@abhishek04204
@abhishek04204 2 жыл бұрын
good explanation, how did you comeup with that idea,how can we develop to think that way. Thank you!
@probabilitycodingisfunis1
@probabilitycodingisfunis1 2 жыл бұрын
Keep practicing more variety of problems and that will help to develop thinking
@shvmsh20
@shvmsh20 2 жыл бұрын
crystal clear
@tejasjadhav8018
@tejasjadhav8018 2 жыл бұрын
@vinaygoswami5374
@vinaygoswami5374 2 жыл бұрын
This question took 2 hrs, but i was not able to solve it using brute force
@loveleshbhagat1114
@loveleshbhagat1114 2 жыл бұрын
class Solution { public: int dx[4] = {0,1,0,-1}; int dy[4] = {1,0,-1,0}; void dfs(int i,int j,int z,vector& heights,vector&reach){ reach[i][j][z]=1; for(int k=0;k=0 && ni=0 && nj
@probabilitycodingisfunis1
@probabilitycodingisfunis1 2 жыл бұрын
Thanks Lovelesh
@maqsoodahmad-vx8jl
@maqsoodahmad-vx8jl Жыл бұрын
Thanks but really need hindi teacher 😢
#Leetcode #200. Number of #Islands || Code + Explanation
14:06
Code with Alisha
Рет қаралды 7 М.
Pacific Atlantic Water Flow - Leetcode 417 - Python
16:28
NeetCode
Рет қаралды 191 М.
Creative Justice at the Checkout: Bananas and Eggs Showdown #shorts
00:18
Fabiosa Best Lifehacks
Рет қаралды 8 МЛН
The Ultimate Sausage Prank! Watch Their Reactions 😂🌭 #Unexpected
00:17
La La Life Shorts
Рет қаралды 8 МЛН
Pacific Atlantic Water Flow - Leetcode 417 - Graphs (Python)
17:10
How I would learn Leetcode if I could start over
18:03
NeetCodeIO
Рет қаралды 695 М.
touristream 011: Codeforces Educational 95
2:14:59
Gennady Korotkevich
Рет қаралды 111 М.
Leetcode 329. Hard || Longest Increasing Path in a Matrix
20:56
Code with Alisha
Рет қаралды 7 М.
Pacific Atlantic Water Flow | Live Coding with Explanation | Leetcode - 417
13:32
Creative Justice at the Checkout: Bananas and Eggs Showdown #shorts
00:18
Fabiosa Best Lifehacks
Рет қаралды 8 МЛН