Skip to content

Find All Numbers Disappeared in an Array, Min and Max in Array and Game of Life#1873

Open
anirudhv98 wants to merge 2 commits into
super30admin:masterfrom
anirudhv98:master
Open

Find All Numbers Disappeared in an Array, Min and Max in Array and Game of Life#1873
anirudhv98 wants to merge 2 commits into
super30admin:masterfrom
anirudhv98:master

Conversation

@anirudhv98
Copy link
Copy Markdown

Completed Array-2, please review.

@super30admin
Copy link
Copy Markdown
Owner

Disappeared Numbers (Problem1.cs)

Strengths:

  • Excellent implementation of the in-place marking algorithm
  • Achieves optimal O(n) time complexity with O(1) auxiliary space
  • Clean code structure with clear comments explaining complexity
  • Proper handling of edge cases (using Math.Abs for safety)
  • Follows the follow-up requirement perfectly

Areas for Improvement:

  • The comment header could be more comprehensive by explaining the algorithm approach
  • Could add a brief explanation of why we use negation to mark visited elements

This is a textbook-optimal solution that demonstrates strong understanding of array manipulation techniques and in-place algorithms.

VERDICT: PASS


max and min (Problem2.cs)

The student submitted a solution for the "max and min" problem, but their code is actually for the "Game of Life" problem. This is a clear mismatch between the problem they were asked to solve and the solution they submitted.

  1. Correctness: The submitted code solves a completely different problem (Game of Life) rather than the "max and min" problem described. Therefore, it does not solve the intended problem at all.

  2. Time Complexity: The reference solution for "max and min" has O(n) time complexity, while the student's "Game of Life" solution has O(m*n) time complexity. Since the problems are different, this comparison is not meaningful.

  3. Space Complexity: The reference solution uses O(1) space, while the student's solution uses O(1) space as well (no additional data structures proportional to input size).

  4. Code Quality: The student's code is well-structured for the Game of Life problem, with clear method separation (Helper, GetNeighbours) and good use of directions array. However, it doesn't address the problem at hand.

  5. Efficiency: The solution efficiently handles the Game of Life problem using in-place state encoding (2 and 3) to track transitions without extra space.

The student's solution is a good answer to the wrong question. They solved a different problem than what was assigned. This could be due to submitting the wrong file or misunderstanding the problem assignment. The code itself demonstrates good understanding of the Game of Life problem but is irrelevant to the "max and min" problem they were asked to solve. The student should resubmit the correct solution for the "max and min" problem.

VERDICT: NEEDS_IMPROVEMENT


Life Game

Strengths:

  1. Correctly implements the in-place algorithm using intermediate states (2 and 3) to track transitions
  2. Good separation of concerns with helper methods
  3. Proper boundary checking in GetNeighbours
  4. Includes helpful comments explaining time/space complexity
  5. Clean and readable code structure

Areas for Improvement:

  1. The direction array could be organized more systematically (group cardinal and diagonal directions separately) for better readability
  2. Consider adding comments explaining the intermediate state values (2 and 3) for future maintainability
  3. The solution is otherwise complete and well-implemented

The solution is functionally equivalent to the reference solution and demonstrates good understanding of the problem.

VERDICT: PASS

@anirudhv98 anirudhv98 changed the title Find All Numbers Disappeared in an Array and Game of Life Find All Numbers Disappeared in an Array, Min and Max in Array and Game of Life May 16, 2026
@anirudhv98
Copy link
Copy Markdown
Author

Added solution for Min and Max in Array

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