Skip to content

Correct Space Complexity and Optimized Solution for LeetCode 383: Ransom Note #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 28, 2024

Conversation

Tesfamichael12
Copy link
Contributor

How are you doing Greg,

I've identified an issue with the current solution for LeetCode 383: Ransom Note. The existing solution did not accurately reflect the correct space complexity, which I have now corrected. Additionally, I've optimized the code to make it more clear and concise keeping the same logic ofcource(I used the Counter function instead of a manual for loop to populate the hashmap.).

Changes:

-> Renamed counter to hashmap to undo any confusion in other languges
-> Corrected the space complexity analysis in the comments.
-> Refined the code for better readability and efficiency.

I also want to mention that Algomap has been incredibly useful, and I've been actively using it to improve my problem-solving skills. Thank you for this great resource!

Looking forward to your feedback.

Best regards,
Tesfamichael

@gahogg gahogg merged commit ee6f841 into gahogg:main Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants