User Input Output Leetcode Problem