Returns the next permutation of a number greater than that number, else it returns -1.