revised leetcode_44 - 50