Leetcode solving: 1704

visit shbcf.ru