Birthday Cake Candles

  • + 1 comment

    my function is as follows:

    static int birthdayCakeCandles(Integer n, Integer[] ar) 
     {
            int count=0;
            List<Integer> cardsList =Arrays.asList(ar);
            Integer max=Collections.max(cardsList);
           for(int j=0;j<cardsList.size();j++)
           {
           
               if(cardsList.get(j)==max)
               {
                   System.out.println("TMC");
                   count++;
               }
               else
                                  System.out.println("BCMK");
           }
            return count;
        }
    
    but it checks the integer values only upto 127. can anyone help me out?.
    PS: I have attached the output of the program.
    

    image