Toptal Interview Question

A hardened version hard question in leetcode