hackrank Sorting Array of Strings 1intflag =1;2intdistinct_characters(constchar*a);34intlexicographic_sort(constchar* a,constchar*b) {56if(strcmp(a, b) >0){7flag =0;8}elseflag =1;910returnflag;11}1213intlexicographic_sort_reverse(constchar* a,constchar*b) {14if(strcmp(a, b) <0)...
Array is sorted in numSwaps swaps., where is the number of swaps that took place. First Element: firstElement, where is the first element in the sorted array. Last Element: lastElement, where is the last element in the sorted array. Hint: To complete this challenge, you must add a var...