Byte Depth
← All tags

#Hash Map

2 articles

DSA

Sort Characters By Frequency

Max-heap on character frequency. Time O(n + d log d), Space O(d) where d = distinct characters.

Medium·Sep 16, 2026
DSAHeapPriority Queue🏢 Amazon

DSA

340. Longest Substring with At Most K Distinct Characters

Covers: Brute Force O(n²), Sliding Window O(n). Classic premium sliding-window problem using a character frequency map.

Medium·Aug 25, 2026
DSAStringsSliding Window
© 2026 ByteDepth. All rights reserved.Built with care for curious engineers.