Ternary Operator recursion