Search
⌘K

Leetcode 2502. Design Memory Allocator

Design an allocator for n memory units that supports allocating the leftmost contiguous block of a given size and freeing all units with a given mID. The core challenge is efficiently tracking and updating free intervals and mID→allocated-interval mappings so you can find/carve the leftmost fit and merge freed segments.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.