Rakuten Interview Question

Complete a typical algorithm coding exercise