Solve Sliding Window and Grid Search | Bytedance Coding Question