Piyush Chaudhary
Results
5
comments of
Piyush Chaudhary
Complexity will remain same in case of recursion.
Yeah it will. But I think we have to assume that our system can handle O(n) space.
It should work IMHO.
Your location of null check is incorrect.