Lamps/Streetlights CodeSignal Coding Question - Sweep Line Algorithm

  Рет қаралды 6,618

Stephen W

Stephen W

Күн бұрын

Similar problem with identical approach and a great explanation:
leetcode(.)com/problems/number-of-flowers-in-full-bloom/solutions/1976821/java-sweep-line-algorithm/
If anything in the video didn't make sense I would read ^
0:00 Problem Description
3:50 Line Sweep Algorithm
7:09 Walk through
13:31 Coding (java)

Пікірлер: 14
@devinpadron5
@devinpadron5 5 күн бұрын
Great explanation. Just flunked my OA with this one (solved with TLE). Appreciate the vid.
@alifrahman7099
@alifrahman7099 2 ай бұрын
This video is crazy well produced and you are an amazing explainer. I really hope you do produce more videos, the competetive coding community would benefit greatly!
@deepakantoj432
@deepakantoj432 Ай бұрын
woah 5 minutes into the video and i already have a clear cut idea of what line sweep means. great job.
@FarzanHashmi
@FarzanHashmi Жыл бұрын
came from a lc discussion forum. this was a very very well produced vid and u explained the solution very well. please continue making more!
@shauryakumar4791
@shauryakumar4791 3 күн бұрын
good one bro
@aftereffectstraining7668
@aftereffectstraining7668 4 ай бұрын
Great explanation. Learned so much from it.
@PedroContipelli2
@PedroContipelli2 11 ай бұрын
Nice! I had a similar problem where I had to count the number of total spots only illuminated by one light. Wasn't able to solve within the time limit but came up with this solution afterwards. Glad to know it was right :)
@DhruvBohara-ct4ye
@DhruvBohara-ct4ye 9 ай бұрын
His did u solve the problem you are taking about
@honestaditya6860
@honestaditya6860 Жыл бұрын
Really helpful, I always get stuck on the 4th question in a codesignal. Do you have any tips/suggestions that for this kind of situation? I want to get really better at this.
@alessiotucci0
@alessiotucci0 4 ай бұрын
great explanation, Roblox ask those kind of question in their online assesment
@lunardesigner6779
@lunardesigner6779 4 ай бұрын
Hello brother, thanks for the explanation. May I know where to access all the questions similar to this one. Thank in advance
@k.8597
@k.8597 6 ай бұрын
What are the bounds on the coordinates? depending on what they are, we could translate every co-ordinate by some fixed k to be nonnegative, declare arr = [0] * (max_light_coordinate) mark start and end of a lit spot by 1, -1 for light in lights: arr[light[0]] = 1 arr[light[1]] = -1 have a map for the benches for fast lookup for i in range(1, len(arr)): arr[i] = arr[i-1] + arr[i] if i in bench_map: bench_map[i] = arr[i] then u just return the key, value pairs inside the bench_map as needed. O(n). Lemme know if this fails any edge case
@theyayaa
@theyayaa 9 ай бұрын
I solved this one but in O(N^2)
@joshuapark7
@joshuapark7 9 ай бұрын
I just got asked this question. I got time limit exceeded.
Offline Algorithms and the Sweepline, Explained
29:06
Joshua Chen
Рет қаралды 2,7 М.
Sweep Line Algorithm Explanation
9:14
Algorithms Casts
Рет қаралды 14 М.
KINDNESS ALWAYS COME BACK
00:59
dednahype
Рет қаралды 167 МЛН
Sigma Kid Hair #funny #sigma #comedy
00:33
CRAZY GREAPA
Рет қаралды 33 МЛН
Rust Tips to Boost your Skill
4:22
Rust without rust
Рет қаралды 233
Bentley-Ottmann algorithm
1:18
Christopher T. Chubb
Рет қаралды 7 М.
Convex Hull Algorithm - Graham Scan and Jarvis March tutorial
7:24
Monotonic Stack Data Structure Explained
5:43
AlgoMonster
Рет қаралды 34 М.
20 System Design Concepts Explained in 10 Minutes
11:41
NeetCode
Рет қаралды 924 М.
Union Find in 5 minutes - Data Structures & Algorithms
5:46
Potato Coders
Рет қаралды 196 М.