Input: arr[] = [5, 3, 8, 4, 2, 7, 1, 10]
Output: [1, 3, 2, 4, 8, 7, 5, 10]
Explanation: The partition index is 3 and pivot element is 5, all elements smaller than pivot element [1, 3, 2, 4] were arranged before partition index and elements larger than or equal to pivot [13, 9, 12, 11] were arranged after partition index.
Input: arr[] = [12, 10, 9, 16, 19, 9]
Output: [9, 10, 9, 16, 19, 12]
Explanation: The partition index is 2 and pivot element is 12, all elements smaller than pivot element [9, 10, 9] were arranged before or at partition index and elements larger than or equal to pivot [16, 19, 12] were arranged after partition index.