Permutations of Strings

  • + 1 comment

    Thanks but if size of array is large..I think better to start at the end:

    for (int i = n-2; i >=0; i--) {
        if (strcmp(s[i], s[i + 1]) < 0) {
            k = i;
            break;
        }
    }