Frage im Vorstellungsgespräch bei Meta

Write a program that returns the next permutation given an array of integers.