Permutations of Strings

  • + 0 comments

    I have done the program in the following manner but this program does not execute all test cases. void swap(char s, int p, int q) { char temp=s[p]; s[p] = s[q]; s[q] = temp; } void reverseWords(char s, int a, int z){ while(a
    * Complete this method * Return 0 when there is no next permutation and 1 otherwise * Modify array s to its next permutation */ for(int i=0;i return 0; }

    the above program satisfies 0 to 7 test cases. 8 to 42 test cases does not satisfies. please provide the correct solution.