DEV Community

Cover image for Learn Trapping Rain Water, Top K Frequent and Selection Sort with Step-by-Step Visualization in DSA View View πŸ‘€πŸ‘€

Learn Trapping Rain Water, Top K Frequent and Selection Sort with Step-by-Step Visualization in DSA View View πŸ‘€πŸ‘€

nyaomaru on September 09, 2026

Hoi hoi! I’m @nyaomaru, a frontend engineer who has been obsessed with ramen lately. 😸🍜 Have you used DSA View View already? πŸ‘€πŸ‘€ I Built a...
Collapse
 
onizuka profile image
Onizuka •

The two-pointer approach on Trapping Rain Water is one of those problems where visualization actually matters β€” I've seen people memorize the code without understanding why left < right even works, then freeze on variants like "trapping rain water II" on a 2D grid. The "count first, then organize by frequency" framing for Top K is solid, but worth noting that the bucket-sort approach only wins when k is small relative to n β€” a heap is the boring but correct answer more often than people admit.

Collapse
 
nyaomaru profile image
nyaomaru •

Thank you! 😸

I also think visualization helps turn these problems from something you memorize into something you actually understand, so I’d be really happy if you give DSA View View a try! πŸ‘€

And thanks for pointing out the trade-off with the bucket approach too. The bucket version gives us linear-time behavior, but it also allocates space based on n, while a heap can be a better practical choice when k is small or memory matters.

Handling the size of the data structure is definitely an important part of the design too.

Collapse
 
xulingfeng profile image
xulingfeng •

Wow, this is awesome! You managed to make those dry, boring algorithms so engaging. Between us, back when I tried reading algorithm books, I’d doze off the second I closed my eyes. I never picked them up again, hahaπŸ˜‚. If the tutorials I had back then were this fun, I would’ve been way better at this stuff.🀣

Collapse
 
nyaomaru profile image
nyaomaru •

Thx! 😸

Honestly, DSA isn’t always the most enjoyable thing to learn, so I tried to make it as fun and approachable as possible. πŸ‘€βœ¨

I’m really happy you enjoyed it! 😹

Collapse
 
xulingfeng profile image
xulingfeng •

Nice work! Visuals make DSA much easier to learnπŸ‘

Collapse
 
koda2026 profile image
Harun - solo dev •

The step-by-step visualization on Trapping Rain Water is clean. The moment where you track the left/right max arrays side-by-side is exactly the mental model beginners miss. Building something similar for my KODA LEARN lessons β€” thanks for the reference. πŸ™Œ

Collapse
 
nyaomaru profile image
nyaomaru •

DSA is fundamental, but I think it really supports the way engineers think and solve problems.

So I think making it a core part of your learning content is a great idea!

Good luck with KODA LEARN! πŸ’ͺ😸

Collapse
 
technogamerz profile image
π“π‘πž π‹πšπ³π² 𝐆𝐒𝐫π₯ •

Excellent!

Collapse
 
nyaomaru profile image
nyaomaru •

Thx! 😸

Collapse
 
technogamerz profile image
π“π‘πž π‹πšπ³π² 𝐆𝐒𝐫π₯ •

Welcome 🐈

Collapse
 
richard_smith_154156d471ef profile image
Richard Smith •

Love the step-backward feature. Being able to rewind mid-loop is so clutch when you lose track of a variable and don't want to restart everything.

Collapse
 
nyaomaru profile image
nyaomaru •

Thx! 😸

Actually, this feature has been improved based on user feedback!

github.com/nyaomaru/dsa-view-view/...

So I’m really happy to hear that you found the step-back feature useful. πŸ‘€

If you have any requests or run into any issues, feel free to reach out anytime!

Collapse
 
publiflow profile image
PubliFlow •

Interesting TypeScript approach. I'd emphasize that strict null checks and noUncheckedIndexedAccess are non-negotiable for production code β€” the number of runtime errors they prevent is remarkable.

Collapse
 
nyaomaru profile image
nyaomaru •

Thank you! I agree. 😸

I also think strictNullChecks and noUncheckedIndexedAccess are really important for production code.

And for values that still need runtime validation, I like using reusable type guards too. That’s actually one of the reasons I built is-kit. πŸ‘€

is-kit.dev/

Collapse
 
publiflow profile image
PubliFlow •

Nice TypeScript write-up. The utility types (Pick, Omit, Extract, Exclude) are underrated β€” proper use of conditional types can eliminate a lot of boilerplate while maintaining type safety.

Collapse
 
publiflow profile image
PubliFlow •

Nice TypeScript patterns. Side note: we shipped 12 AI tools under tools.shopveigo.com using strict TS end-to-end. The discriminated union pattern you mentioned was key for our API routing.

Collapse
 
byteninja01 profile image
Ujjwal Sharma •

I tried , its amazing ! but more amazing to see that you have not missed any commit on GitHub from 6th Jan 2025 ! Amazing consistency

Collapse
 
nyaomaru profile image
nyaomaru •

Thanks for trying DSA View View! I’m really happy to hear that 😸

I traveled around Europe, and after that I realized that consistency is one of the most important things in life.

So I try to keep developing something every day as much as I can πŸ‘