H2Compute interview question

Basic React Hooks