Finding smallest next bigger element
问题 I have a task which requires me to find the smallest of all bigger elements in an array for all array entries and store the respective indexes in an array and I can't quite figure out the last part of the solution. This is kind of similar to the problem explained here: https://www.geeksforgeeks.org/smallest-greater-elements-in-whole-array/ The only difference is that only the values right of the array entry are accounted for (j>i), e.g.: input: [80; 19; 49; 45; 65; 71; 76; 28; 68; 66] output: