Windsurf Interview Question

Asked one leetcode hard problem for OA