UiPath Interview Question

Find min element in rotated sorted array and nearest greater element