- Reading and understanding the problem and requirements: 20 minutes
- Simulation on draft paper by hands and get pseudo-code: 30 minutes
- Setup Rails 5.1 and Preparation of tests: 30 minutes
- Algorithm implementation: 1 hour 30 minutes
- Benchmark: 10 minutes
- Completing tests: 40 minutes
Total: 3 hours 40 minutes