https://codesandbox.io/s/real-interview-problem-3v2db?file=/src/App.tsx