Leetcode tested code