JUMP GAME V | LEETCODE 1340 | PYTHON GRAPH + DFS SOLUTION

  Рет қаралды 1,076

Cracking FAANG

Cracking FAANG

Күн бұрын

Пікірлер: 5
@AnandKumar-kz3ls
@AnandKumar-kz3ls Жыл бұрын
wow you just changed my prespective of seeing jump game problems how you come up with using graph data structure
@crackfaang
@crackfaang Жыл бұрын
Don't be surprised at the lengths I am willing to go to avoid using DP
@zahraaskarzadeh5618
@zahraaskarzadeh5618 Жыл бұрын
Thanks
@AnandKumar-kz3ls
@AnandKumar-kz3ls Жыл бұрын
Hi , im getting TLE in c++ Edit: i just passed the reference of graph now it get accepted int dfs(int u,vector& graph,vector& dp){ if(dp[u]!=-1) return dp[u]; int jumps=1; for (auto v : graph[u]) jumps=max(jumps,1+dfs(v,graph,dp)); return dp[u]=jumps; } int maxJumps(vector& arr, int d) { int n=arr.size(); vector dp(n,-1); vector graph(n); for(int i=0;i
@crackfaang
@crackfaang Жыл бұрын
Glad you got it working. I can’t guarantee other languages work with the solution given. The cutoffs are often different and some code is not transferable
Dependency Injection, The Best Pattern
13:16
CodeAesthetic
Рет қаралды 917 М.
Сестра обхитрила!
00:17
Victoria Portfolio
Рет қаралды 958 М.
Quando A Diferença De Altura É Muito Grande 😲😂
00:12
Mari Maria
Рет қаралды 45 МЛН
Каха и дочка
00:28
К-Media
Рет қаралды 3,4 МЛН
ADD ONE ROW TO TREE | LEETCODE 623 | PYTHON BFS SOLUTION
10:34
Cracking FAANG
Рет қаралды 1,9 М.
Push Dominoes - Leetcode 838 - Python
17:39
NeetCode
Рет қаралды 22 М.
AI Is Making You An Illiterate Programmer
27:22
ThePrimeTime
Рет қаралды 289 М.
Dynamic Programming isn't too hard. You just don't know what it is.
22:31
DecodingIntuition
Рет қаралды 247 М.
Jump Game - Greedy - Leetcode 55
16:28
NeetCode
Рет қаралды 272 М.
MAXIMUM SUBARRAY | LEETCODE 53 | PYTHON OPTIMAL SOLUTION
11:51
Cracking FAANG
Рет қаралды 928
Сестра обхитрила!
00:17
Victoria Portfolio
Рет қаралды 958 М.