My solution is O(n) by creating two sets of unique number. one set is increasing and another set is decreasing.
Any idea if this is correct approach or any other approach?