DP World processes numeric container-handling measurements and character-based event labels. Given an integer array and a string, find the largest sum of any non-empty contiguous subarray and list every character's frequency in the order that character first appears.
Implement max_subarray_and_frequencies(nums, text).
nums is a non-empty list of integers.text is a string containing printable characters. Every character, including spaces and punctuation, must be counted.max_sum: the maximum sum of a non-empty contiguous subarray of nums.frequencies: a list of two-element lists, where each element is [character, count], ordered by first occurrence in text.def max_subarray_and_frequencies(nums, text):