• + 0 comments

    JAVA

    public static List<Integer> breakingRecords(List<Integer> scores) {
        int min = 0;
        int max = 0;
        int minimum = scores.get(0);
        int maximum = scores.get(0);
        for(int i = 1; i < scores.size();i++){
            int value = scores.get(i);
            if(value >maximum){
                max++;
                maximum = value;
            }
            if(value < minimum){
                min ++;
                minimum = value;
            }
        }
        return Arrays.asList(max,min);