Given an array with all distinct elements, find the largest three elements. Expected time complexity is O(n) and extra space is O(1).
Examples:
Input: arr[] = {10, 4, 3, 50, 23, 90} Output: 90, 50, 23