Reverse Nodes in k-Group
Reverse nodes in k-group in a linked list.
Input: head = [1,2,3,4,5], k = 3
Output: [3,2,1,4,5]
Explanation: The first 3 elements are reversed, while the remaining 2 are left untouched since they don't form a complete group.
Search for a Word in a 2D Board
Search for a word in a 2D board of characters.
Input: board = [["C","A","A"],["A","A","A"],["B","C","D"]], word = "AAB"
Output: TRUE
Explanation: DFS traverses adjacent matching letters perfectly, finding "AAB" without improperly revisiting any cells.
Diameter of a Binary Tree
Find the diameter of a binary tree.
Input: root = [1,2]
Output: 1
Explanation: The longest path is simply the single edge connecting the root node to its only child.
Unique Combinations that Sum to a Target
Find all unique combinations in an array that sum to a target.
Input: candidates = [2,4,6], target = 6
Output: [[2,2,2], [2,4], [6]]
Explanation: Uses backtracking to find all valid combinations that sum to 6, allowing for explicitly repeated elements.
Imagine a situation where a customer is struggling to communicate with you due to a language barrier. What steps would you take to ensure their issue is resolved?