personal ans for leetcode's OJ