Break a string into space-separated words using a dictionary.
Given a string s and a dictionary of strings wordDict, return true if s can be segmented into a space-separated sequence of one or more dictionary words.
Input: s = "catsandog", wordDict = ["cats", "dog", "sand", "and", "cat"]
Output: FALSE
Explanation: There is no valid se…
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.
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.
Merge Overlapping Intervals
Merge overlapping intervals in an array.
Input: intervals = [[1,4],[4,5]]
Output: [[1,5]]
Explanation: The intervals touch exactly at the 4 mark, so they are successfully merged into a single continuous interval.
Iterator over a Binary Search Tree
Implement an iterator over a binary search tree.
Input: root = [7,3,15,null,null,9,20], calls: next(), hasNext(), next()
Output: 3, TRUE, 7
Explanation: The iterator yields the smallest value (3), confirms more nodes exist, then properly yields the next in-order value (7).