[LeetCode | Java | 주제 문제 풀이] 1512. Number of Good Pairs - Solution with 1)HashMap 2)Array 3)Stream API
99 Club 2기 | Java | Beginner1512. Number of Good Pairs🏷 관련 주제 : Array Hash Table Math CountingEasyGiven an array of integers nums, return the number of good pairs.A pair (i, j) is called good if nums[i] == nums[j] and i j.Example 1:Input: nums = [1,2,3,1,1,3]Output: 4Explanation: There are 4 good pairs (0,3), (0,4), (3,4), (2,5) 0-indexed.Example 2:Input: nums = [1,1,1,1]Output: 6Explanation: E..
2024. 6. 15.