1. Breaking the Records
  2.  
  3. Maria plays college basketball and wants to go pro. Each season she maintains a record of her play. She tabulates the number of times she breaks her season record for most points and least points in a game. Points scored in the first game establish her record for the season, and she begins counting from there.
  4.  
  5.  
  6. public static List<Integer> breakingRecords(List<Integer> scores) {
  7. // Write your code here
  8. int min=scores.get(0);
  9. int cMin=0,cMax=0;
  10. int max=scores.get(0);
  11. ArrayList<Integer>res=new ArrayList<>();
  12. for(int i=1;i<scores.size();i++)
  13. {
  14. if(min>scores.get(i))
  15. {
  16. min=scores.get(i);
  17. cMin++;
  18. }
  19. if(max<scores.get(i))
  20. {
  21. max=scores.get(i);
  22. cMax++;
  23. }
  24. }
  25. res.add(cMax);
  26. res.add(cMin);
  27. return res;
  28.  
  29. }