add maximum gap

this problem is not the same as the max gap problem in leetcode