Your question is Rotate Array and Special Characters. 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.
DP World systems may need to reorder event identifiers while preserving formatting in human-readable labels. Implement one function that rotates an integer array, computes character frequencies, and reverses only alphanumeric characters while leaving special-character positions unchanged.
Given an integer array nums, a non-negative rotation amount k, and a string text, return a dictionary with:
rotated: nums rotated to the right by k positions.frequencies: a case-sensitive frequency dictionary containing every character in text, including spaces and punctuation.reversed: a string formed by reversing all alphanumeric characters in text, while every non-alphanumeric character remains at its original index. Use Python's str.isalnum() to classify characters.The input array may be modified in place. The returned array must contain the same values as the input, only in rotated order.
def process_data(nums, k, text):