The class is initialized with an array of integers nums.
Inside the class, a dictionary is used to count how many times each number appears in the nums array.
It then iterates through the nums array, updating the count for each number in the dictionary.
After counting, it calculates the number of good pairs for each number (where a good pair is two equal numbers with the first one occurring before the second).
Finally, it returns the total count of good pairs for the entire nums array.
List any dependencies that are required for this change.
Flow of Program -
Put check marks:
Have you made changes in README file ?
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Please also note any relevant details for your test configuration.
Make sure all below guidelines are followed else PR will get Reject: