OpenAI Interview Question

implementation heavy leetcode style question involving array manipulation