A hash set finds a linked list cycle in O(n) space. Then the interviewer asks for O(1).
One pointer steps once, one steps twice. If the list loops, the fast one always catches the slow one.
1
8
Every bracket in {[(])} has its pair, and the string is still invalid.
Counting brackets can't catch it. The bracket opened last has to close first, and that's exactly what a stack does.
1
49
Full walkthrough: youtu.be/nFS0_LC_Dr8
Solve it yourself: firecode.io/problems/py/two-…
14
Two Sum comes down to one question: for each number, have I already seen the one that completes it?
Keep a map of what you've seen and it's a single pass, O(n).
The full 9-minute walkthrough, with the sorted-array follow-up, is in the reply.
1
37
Less LeetCode. More job offers.
Firecode is 50% off for life until Nov 30. Practice the patterns, and Firecode brings each one back right before you'd forget it, so it's still there on interview day.
1
40
New on Firecode: system design interviews 🔥
Practice the real problems FAANG interviewers ask, like Design a URL Shortener, on a real whiteboard, with feedback on every step at your level.
Here's the whole URL shortener, end to end.
2
3
91
Look at the timestamps 😂 This is really sad @Microsoft , can we please aggressively hire some cracked SREs to fix this? firecode.io has a huge pipeline of cracked engineers, hit us up if you need a hookup
2
152





