greedy approach to solve max area