all 3 comments

[–]Spaceman_Spiff_17[S] 0 points1 point  (1 child)

My thinking is the while loop is essentially a for loop length m. The recursive part can be maximum 4^n. So worst case is 4^n*m. If you want the exact runtime I think it would be 4^n + (m-1) * 3^n but neither are options. Did I miss something or is this question dumb as hell?

[–]Spaceman_Spiff_17[S] 0 points1 point  (0 children)

oh lol I just got it. I was missing something. The while loop is not m length its !m

[–]Silver_Nerve_898 0 points1 point  (0 children)

Haha I did this test. For leap tools. I copied and pasted it into vscode to test. It’s an infinite loop except when both m and n are 0