Solve a classic string manipulation or array-based problem using optimal time and space complexity at Booking Holdings.