As part of a Luxoft engineering assessment, implement four independent algorithms in one Python function. Return the required result for each task: find a pair summing to a target, merge overlapping intervals, find the longest substring without repeated characters, and determine whether two strings are anagrams.
Implement solve_all(nums, target, intervals, s, t). Return a dictionary with these keys:
two_sum: the zero-based indices of the unique pair in nums whose values sum to target, or [] if no pair exists.merge_intervals: all overlapping intervals merged and sorted by start time.longest_substring: the length of the longest substring of s containing no repeated characters.valid_anagram: true if s and t contain the same characters with the same frequencies, otherwise false.Intervals are represented as two-element lists [start, end]. Treat strings as case-sensitive and compare every character, including spaces and punctuation.
def solve_all(nums, target, intervals, s, t):