Bigger Is Greater Hackerrank Solution C -
The goal is to increase the string's value as little as possible by making a change as far to the right as possible. Bigger is Greater | HackerRank
// Find the first pair of digits that are in increasing order for (i = n - 2; i >= 0; i--) if (str[i] < str[i + 1]) break; bigger is greater hackerrank solution c
return str;
// Function to reverse a substring from index 'start' to 'end' void reverse(char *str, int start, int end) while (start < end) swap(&str[start], &str[end]); start++; end--; The goal is to increase the string's value