http://www.nxcoding.com/archives/leetcode-daily-2612-minimum-reverse-operations