codedecks-in / LeetCode-Solutions

This repository consists of solutions to the problem from LeetCode platform. Subscribe to our Channel for more updates
https://www.youtube.com/c/codedecks
MIT License
831 stars 419 forks source link

Created 1512_Number of Good Pairs.py #440

Closed OjasTulswani closed 8 months ago

OjasTulswani commented 1 year ago

Flow of Program -

  1. The class is initialized with an array of integers nums.
  2. Inside the class, a dictionary is used to count how many times each number appears in the nums array.
  3. It then iterates through the nums array, updating the count for each number in the dictionary.
  4. 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).
  5. Finally, it returns the total count of good pairs for the entire nums array. List any dependencies that are required for this change.

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:

welcome[bot] commented 1 year ago

I can tell this is your first pull request! Thank you I'm so honored. :tada::tada::tada: I'll take a look at it ASAP!