Back to problems

Implement a Simple Key-Value Store from Scratch

Object-Oriented Programming · OpenAI · Medium

Create a basic key-value database that keeps all data in memory. Requirements Handle these commands: PUT key value: add a new entry or replace the existing value for that key GET key: output the associated value, or output NULL when the key does not exist DEL key: remove the key when it is stored COUNT: output how many keys are stored at that moment Input (stdin) Line one contains an integer Q. Each of the following Q lines contains exactly one command. Both key and value…

Checking your access…