238. A Function That Grows Too Fast
The Ackermann function is defined as:
A(0, n) = n + 1
A(m, 0) = A(m - 1, 1)
A(m, n) = A(m - 1, A(m, n - 1))
Print A(m, n).
Read the third line carefully: the second argument of the outer call is itself a recursive call. That nesting is why this function cannot be rewritten as a simple loop, and it is the classic example of a function that is computable but not primitive recursive.
It also grows absurdly fast. A(4, 2) has 19,729 digits, so the constraints
here are tiny on purpose.
Constraints - `0 ≤ m ≤ 3` - `0 ≤ n ≤ 6`
Input
A single line containing two integers m and n.
Output
Print one integer, the value of A(m, n).
Hints
Four rungs, in order. The last two open once you have submitted an attempt. A wrong one counts.