ByteDance Interview Question

It's just the leetcode live coding challenge