Question 1:
Count the unique elements in an Sorted Array.
Example:
Input: [1, 1, 1, 1, 2, 2, 2, 2, 5, 5, 5, 7, 7, 8, 8, 10]
Output = 6
Provided O(n) solution with constant O(1) space.
Couldn't come up with any logn approach :(
Question 2:
Variation of https://leetcode.com/problems/clone-graph/
Graph Class was provided with vector
Graph {
vector<Node*> nodes ;
}
Node {
int val ;
vector<Node*> Neighbors ;
}