Leetcode-Solutions icon indicating copy to clipboard operation
Leetcode-Solutions copied to clipboard

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

Open Tesfamichael12 opened this issue 1 year ago • 0 comments

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

Tesfamichael12 avatar Aug 12 '24 01:08 Tesfamichael12