// Next Permutation — MEDIUM
// Category: array
A permutation of an array of integers is an arrangement of its members into a sequence or linear order.
Given an array of integers `nums`, find the **next permutation** (lexicographically next greater arrangement). If no such arrangement is possible, rearrange it to the lowest possible order (ascending).
**Algorithm:**
1. Find largest index `i` where `nums[i] < nums[i+1]`.
Example: nums = [1,2,3]
Output: [1,3,2]