Counting repeated elements in an integer array

前端 未结 13 1288
挽巷
挽巷 2020-11-27 08:02

I have an integer array crr_array and I want to count elements, which occur repeatedly. First, I read the size of the array and initialize it with numbers read

13条回答
  •  粉色の甜心
    2020-11-27 08:12

    private static void getRepeatedNumbers() {

        int [] numArray = {2,5,3,8,1,2,8,3,3,1,5,7,8,12,134};
        Set nums = new HashSet();
        
        for (int i =0; i

提交回复
热议问题