• + 0 comments

    we dont think about last index. the way become fast to find last position for element.

    for(int i=0;ii) { min=min<(j-i)?min:(j-i); } }