The accepted code by Leetcode