ByteDance Interview Question

To code a leetcode style question