Is there a way to add own test cases and see expected output on Leetcode? I feel like this would be helpful feature because the examples provided generally cover few edge cases only. I think I've seen some one create test case tree via comments and the run test for that. ex: check if following is valid BST, resulting in false /* 1 / \ 2 3 */
This is one of the hurdles that make a huge difference in your ability to solve problems. Take some time to focus on recursion. Look at various simpler recursive problems until you can start to see patterns and visualize how it works. Once you can visualize recursion it will be a quantum leap forward in your programming skills. There are a lot of milestones like this, just try not to get discouraged and keep finding material on the subject until it clicks. You'll eventually have enough practice or find the perfect lesson for you that will make it 'click'.