Https Leetcode Com Problems Nested If Else In Java