Your question is Reverse a Linked List. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Yelp Reservations processes booking-status events in fixed-size batches. Given an array of status identifiers, reverse the elements within every complete group of k consecutive elements, modifying the array in place. If the final group contains fewer than k elements, leave that group unchanged.
Return the modified array.
statuses, a list of integers, and k, a positive integer.k elements.def reverse_batches(statuses, k):