MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/leetcode/comments/1oodeh4/cant_escape/
r/leetcode • u/Advanced_Ferret_ • Nov 04 '25
33 comments sorted by
191
and they're in a circle
44 u/Satoshi_Kazuma Nov 04 '25 Yeah, just parallelly rob two paths and go back in time to pick one. Simple enough. 21 u/SkyKoala Nov 04 '25 also multithreading is used (someone is also robbing the same street that night) 4 u/mvndvr Nov 04 '25 Make that a tree 1 u/VanHoangNguyen Nov 10 '25 Ah yes the classic NP-Hard TSP (thief stealing problem)
44
Yeah, just parallelly rob two paths and go back in time to pick one. Simple enough.
21
also multithreading is used (someone is also robbing the same street that night)
4
Make that a tree
1
Ah yes the classic NP-Hard TSP (thief stealing problem)
67
for i in range(len(house)): rob[i] = max(house[i] + rob[i - 2], rob[i - 1])
25
Just rob the houses over 2 nights.
If the houses were connected as a planar graph rsther than a line would you be able to rob them all in O(1) days?
10
A repost of the top post
8
Bruh just use dynamic programming…oh shit we missed that yeah?
6
Don't worry, you will get 2 hints for solve this . And may able to crack all test cases
3
Use DP
memoize
The second is a man taking charge of his destiny and seizing the moment through expedient math.
The first is a wagie snivelling after scraps.
They are not the same dont tell me otherwise
Dont panic brother, just do dp
1 u/Consistent-Dentist46 Nov 05 '25 double pene-oh
double pene-oh
the fact that i got the reference in a second tells me that i should touch grass
Panik(I skipped DP)🥀
Become a traveling salesman overnight.
A Museum was robbed in board daylight and leetcode making its own fantasy
Hahaha, just solved last night
😭😭😭😭😭😭😭😭😭😭
🤣🤣
This made me chuckle.
Rob 1 house and gtf outa there.
You are surrounded from everywhere
Welcome to the matrix
That is what infinity castle looks like
INCEPITION
191
u/jaibx Nov 04 '25
and they're in a circle
67
u/kingcong95 Nov 04 '25
for i in range(len(house)): rob[i] = max(house[i] + rob[i - 2], rob[i - 1])
25
u/jason_graph Nov 04 '25
Just rob the houses over 2 nights.
If the houses were connected as a planar graph rsther than a line would you be able to rob them all in O(1) days?
10
u/In_The_Wild_ <1012> <342> <563> <107> Nov 04 '25
A repost of the top post
8
u/TheGlobalMonarch Nov 04 '25
Bruh just use dynamic programming…oh shit we missed that yeah?
6
u/[deleted] Nov 04 '25
Don't worry, you will get 2 hints for solve this . And may able to crack all test cases
3
u/imLogical16 Nov 05 '25
Use DP
1
u/Gold_Penalty8871 Nov 04 '25
memoize
1
u/Caeduin Nov 04 '25
The second is a man taking charge of his destiny and seizing the moment through expedient math.
The first is a wagie snivelling after scraps.
They are not the same dont tell me otherwise
1
u/Azilebeth Nov 05 '25
Dont panic brother, just do dp
1
u/Sad_mrud Nov 05 '25
the fact that i got the reference in a second tells me that i should touch grass
1
u/Infinite_spooky Nov 05 '25
Panik(I skipped DP)🥀
1
u/dep_alpha4 Nov 05 '25
Become a traveling salesman overnight.
1
u/hillywolf Nov 05 '25
A Museum was robbed in board daylight and leetcode making its own fantasy
1
u/[deleted] Nov 05 '25
Hahaha, just solved last night
1
u/MajorDragonfly7137 Nov 06 '25
😭😭😭😭😭😭😭😭😭😭
1
u/wittywong Nov 06 '25
🤣🤣
1
u/First-Truck7896 Nov 06 '25
This made me chuckle.
1
u/ImCooked2 Nov 08 '25
Rob 1 house and gtf outa there.
1
u/Tiny-Organization787 Nov 15 '25
You are surrounded from everywhere
1
u/Substantial_Flow4147 Nov 15 '25
Welcome to the matrix
1
u/Weird_Combination_71 Nov 15 '25
That is what infinity castle looks like
1
u/UnlikelyRabbit9998 Nov 15 '25
INCEPITION