Not able to understand the problem

how can i use next_permutation( ) here??

@rohitkandpal683
hello rohit,
if arr is ur array and n is its size then
next_permuation(arr,arr+n);

will give u next greater permutation and if no such permutation possible then it give smallest possible permutation.

so for this problem.

u need to call next_permuation on ur array and then print ur array

thanks for help. now i am able to understand it.