Input:string = "gfg"Output:ggfInput:arr[] = {1, 2, 3}Output:{1, 3, 2} 在C++中,有一个特定的函数使我们免于编写大量代码。它位于头文件#include中。该函数是next_permutation(a.begin(),a.end())。它用于将[first,last]范围内的元素重新排列到下一个字典上更大的排列。排列是