int x for this variable the compiler needs to know when to create memory for it when to destroy it aka how long does it live does another .cpp file refer to this same one are per thread copies The default scope boundaries are commonly known, eccentrics are harder.
A really nice problem occured in ABC 471, if I was smarter I would’ve been able to solve it faster but I did get to a solution and was satisfied with just that too; but to get better must distill it.
Requirements: a maximum capacity get(key) + mark as recent put(key,value) + mark as recent + evict oldest one if inserting ( not updating )at capacity both should be average O(1) high level idea A hashmap is definitely involed to back as the key value store.
I wanted to have a simple polished open source app that treats code as first class; nothing fancy like an LSP but just a little bit of syntax highlightin would be nice.
This is a list of problems with deceptively simple solutions, all that I might’ve either completely missed or arrived at via a contrived way losing the essence and intuition of it.
Bitmask DP Considerations? Do I iterate over set bits and remove them? Is optimal structure a vine Do I iterate over submasks and remove them? Is optimal structure a tree Think bitmask dp, when iterating over permutations of processing order would works.