I know this one front and back, dfs and change the 1s to 0s when we hit an island, saves space, but you could also use a visited set instead
2024-08-01 17:44:54
14
Not Anyone Important :
Solution: iterate all, when you hit a 1, increase your count and do a floodfill. Until you reach the end, return your count 🥰
2024-08-25 16:19:41
0
The Quiz Whiz :
Turn your 1's into 0's using a floodfill.
2024-08-25 03:36:59
0
Noam Podoler :
How about using UnionFind to connect each of cell with its neighbors when they are both 1 and then just check the amout of groups there are?
2024-08-03 16:22:38
0
Potate :
wait… you can do a variation to 2d convolution.
2024-08-04 05:00:54
0
Leo :
I miss the videos when you used to show the code solutions
2024-08-02 19:52:34
4
Dmitriy Nazaratiy :
There is much faster solution. Left-to-right traverse. Declare highest index H=1. Declare set of land indices S. LTR, top-to-bottom traverse array. Each time you face 1: check right to it and ..(2)
2024-08-22 20:49:21
0
WizardRyan :
Why depth and not breadth?
2024-08-10 15:36:28
0
lavender town menace 🌈 🏹 קשת :
This feels like training remote sensing somehow
2024-08-01 17:57:55
0
Marcel Ka :
I'm actually using this algorithms in my project 😂
2024-08-17 17:22:51
0
Axel :
It is not the most asked question, the most asked question is "how to center a div ?"
2024-10-26 07:42:33
0
Deveyes :
I'd build based on a variation of the painter's algorithm
2024-08-01 22:25:02
0
Greg Hogg :
Learn Data Structures & Algorithms for FREE at AlgoMap.io!
2024-08-01 17:38:41
1
Michael Barrowman :
The most asked coding question of all time is "How do I centre a div?" followed by "How do I exit Vim?"
2024-08-01 20:01:34
2
DarkSideT :
This Dwarf Fortress gameplay looks fire
2024-09-21 21:24:23
0
To see more videos from user @greghogg5, please go to the Tikwm
homepage.