I am practicing for CCDSAP Foundation Level. I got stuck while solving the DBOY problem. Following are my solutions, The first one got sigsegv error whereas the latter one got accepted.
The only change in both the code is
Can anyone please tell me why the latter one gets AC.