The direction is right.
You just have to set is_dup to false before the inner loop and set is_dup to true if the inner and outher value match.
btw the inner loop should be
to optimize the soluton a little you could break the inner loop when a duplicate was foundCode:for (int k=j-1; k>=0; k--)
Kurt




Reply With Quote