Recursion Basic Leetcode Problems Sql Server