There is unexpected error in the code

hey @shiva57reddy, it should be j<n-i-1 instead of j<=n-i-1. I have made changes to your code only and indicate them as comments. You can check them here https://ide.codingblocks.com/s/108258.