Tencent Interview Question

some leetcode-style coding problems, mainly about array