leetcode's solution code