My solution towards online judge on leetcode