Reverse Words While Preserving Spaces | Bytedance Interview Question