Decode Ways
Determine the number of valid ways to decode a string of digits.
Input: s = "10"
Output: 1
Explanation: The string can only be decoded one single way, as the sequence '10' maps exclusively to the letter 'J'.
Write the implementation for a deduplication algorithm applied to a live message queue, versus deduplicating a petabyte-scale historical data warehouse.
Calculate the minimum number of parentheses to add to make a string valid.
A parentheses string is valid if and only if it is empty, or properly balanced. Return the minimum number of parentheses you must add to make the resulting string valid.
Input: s = "((("
Output: 3
Explanation: There are three open parentheses without any matchi…
Maximum Depth of an N-ary Tree
Find the maximum depth of an N-ary tree.
Input: root = [1,null,2,null,3,null,4]
Output: 4
Explanation: The tree is essentially a straight line, requiring a traversal that reaches a maximum depth of 4 layers.