This is a leetcode problem solutions