Maximum element in an array which is increasing and then decreasing