Skip to content

Array 2 done#1862

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

Array 2 done#1862
pranjay01 wants to merge 1 commit intosuper30admin:masterfrom
pranjay01:master

Conversation

@pranjay01
Copy link

No description provided.

@super30admin
Copy link
Owner

Strengths:

  • You implemented an optimal solution for the "Disappeared Numbers" problem with O(n) time and O(1) space.
  • The code is clean, well-commented, and easy to understand.
  • You correctly used the negation technique to mark the presence of numbers without extra space.

Areas for Improvement:

  • The solution includes a test call at the end (print statement). In a typical submission (e.g., on LeetCode), the solution should only contain the class and method definitions without any test code. Remove such test calls to avoid runtime errors in automated judging systems.
  • Although not necessary, you could add a brief comment explaining the purpose of the first loop (marking indices) and the second loop (collecting results) for clarity.

Overall, your solution for "Disappeared Numbers" is excellent and meets all requirements.

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