Add Two Numbers Represented as Strings
Add two non-negative integers represented as strings.
Input: num1 = "456", num2 = "77"
Output: "533"
Explanation: Performs character-by-character addition from right to left, carrying the 1 from 6+7=13 to the next decimal place.
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.
Continuous Subarrays Sum Equals K
Find the total number of continuous subarrays whose sum equals K.
Input: nums = [1,2,3], k = 3
Output: 2
Explanation: Both the contiguous subarray [1,2] and the single-element subarray [3] sum perfectly to the target of 3.
Serialize and Deserialize N-ary Tree
Serialize and deserialize an N-ary tree.
Input: root = [1]
Output: 1
Explanation: The tree only contains a root node, resulting in a minimal serialized string representation that can be accurately rebuilt.
Implement the next permutation algorithm.
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such an arrangement is not possible, it must rearrange it as the lowest possible order.
Input: nums = [3,2,1]
Output: [1,2,3]
Explanation: The sequence is strictly decreasing…
Buildings with an Ocean View
Find all buildings that have an ocean view.
Input: heights = [1,2,3,4]
Output: [3]
Explanation: Since the ocean is to the right, only the rightmost tallest building (index 3) is not blocked by any others.