Skip to content

Hashin 2 done#2163

Open
pranjay01 wants to merge 1 commit intosuper30admin:masterfrom
pranjay01:master
Open

Hashin 2 done#2163
pranjay01 wants to merge 1 commit intosuper30admin:masterfrom
pranjay01:master

Conversation

@pranjay01
Copy link

No description provided.

@super30admin
Copy link
Owner

Your solutions demonstrate a good understanding of the problems and you are using efficient approaches. However, there are a few areas for improvement:

  1. Variable Naming and Typos: In Problem1.py, you have a typo in the variable name runinSumMapFreq. You defined it as runinSumMapFreq (with an 'n') but then you use runinSumMapFreq (with an 'n' in the first part and then without the 'n' in the update part). This inconsistency will cause a NameError. Always use consistent and meaningful variable names. Consider using prefix_sum_freq or running_sum_freq to make it clear.

  2. Code Correctness: For Problem1.py, without the typo, the logic is correct. However, it's important to test your code with sample inputs to catch such errors. For example, with nums = [1,1,1] and k=2, your code (with the typo fixed) should return 2.

  3. Efficiency: Your solutions are efficient with optimal time and space complexity. Keep it up.

  4. Code Readability: Your comments are helpful. However, in Problem1.py, the comment says "runinSumMapFreq" which is misspelled. Also, the comment could be more precise: explain why we initialize with {0:1}.

  5. General Practice: Always double-check your variable names for typos. Using an IDE with syntax highlighting can help. Also, consider writing tests for your code.

For Problem2.py and Problem3.py, your solutions are correct and efficient. Well done.

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