496. Next Greater Element I

public class Solution {
    public int[] nextGreaterElement(int[] findNums, int[] nums) {
        ArrayList res=new ArrayList();
        int j=0;
        for(int i=0;ifindNums[i]){
                    res.add(nums[j]);
                    break;
                }
            }
            if(j==nums.length)res.add(-1);                
        }
        return toIntArray(res);
    }
    public int indexof(int[] nums,int target){
        for(int i=0;i list){
        int[] res=new int[list.size()];
        for(int i=0;i

你可能感兴趣的:(496. Next Greater Element I)