revised leetcode_111