- j is initialized outside the loop.
- There is only one array.(and assume its sorted.)
I guess these statements can help you realize something. although i think only the 1st statement is enough to solve this problem.
Consider the following
pankaj-m
#1