Implement two in-place operations without using additional memory allocation: reverse a string represented as a mutable character array, and swap two integers without using a temporary variable.
Write a function that performs one of the following based on the input mode:
mode == "reverse": reverse the list of single-character strings in place.mode == "swap": swap two integers and return the swapped pair.mode, a string equal to "reverse" or "swap"mode == "reverse", data is a list of single-character stringsmode == "swap", data is a list of exactly two integersmode == "reverse", return the modified character listmode == "swap", return the swapped two-element listdef in_place_reverse_or_swap(mode, data):