Coding-ninjas-data-st.-through-java
Coding-ninjas-data-st.-through-java copied to clipboard
Correct runtime error by adding two base cases.
if( head==null ){ // base case1 return head; } if( i==j ){ // base case 2 return head; }