What's the in the code

@17manishms if statement at line 12 of your code should be comparing i with wt[j] not with val[j].