When the ith element is greater than previous element check if adding its cost makes total cost minimum
if ( ele [ i ] > ele [ prev ] ) : NEW_LINE INDENT ans = min ( ans , cost [ i ] + minCost ( i + 1 , i , cnt + 1 , ele , cost ) ) ; NEW_LINE DEDENT return ans ; NEW_LINE