• + 0 comments

    hey!! for Java 8 my solution was this and I´m very happy with it.

    List<Integer> response = new ArrayList<>();
        
        do {
             response.add(arr.size());
             int min =Collections.min(arr);
             arr.removeIf(n-> (n == min));
            
            }
        while (arr.size()>=1);
    
       
       
       return response;