Pergunta de entrevista da empresa CommerceIQ

find next lexicographically greater permutation Input format: {1, 2, 3} Output Arr[] = {2,1,3}