← 返回 amazon 的题目列表Next Greater Element in Circular Integer Array
类型:online_judge
amazon
Given a circular integer array, find the next greater number for every element in the array. The next greater number of a number 'number' is the first greater number to its right. If it does not exist, return -1. For example, for the array [1, 2, 1], the next greater numbers are [2, -1, 2].
Example
Input
3 8 4 1 2