Encode and Decode Strings
Encode a list of strings into a single string and decode it back.
Input: strs = ["","hello",""]
Output: ["","hello",""]
Explanation: Prepends chunk lengths and a delimiter (e.g., "0#5#hello0#") to safely encode and perfectly restore empty strings.
Alien Dictionary Order
Derive the alien dictionary order from a sorted list of alien words.
Input: words = ["z","x","z"]
Output: "" (Empty String)
Explanation: The letter 'z' cannot come before 'x' and then suddenly after 'x', creating a cycle and making the dictionary invalid.
Merge two sorted arrays into one sorted array.
You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing the number of elements in nums1 and nums2 respectively. Merge them into a single array sorted in non-decreasing order.
Input: nums1 = [0], m = 0, nums2 = [1], n = 1
Outp…