Remove Duplicates from Sorted Array II, Merge Sorted Array and Search a 2D Matrix II#1785
Remove Duplicates from Sorted Array II, Merge Sorted Array and Search a 2D Matrix II#1785anirudhv98 wants to merge 1 commit into
Conversation
… Search a 2D Matrix II
Merging of 2 arrays (Problem1.cs)Looking at this evaluation, I need to assess the student's solution against the problem requirements. Problem Understanding: Student's Solution Analysis:
This solution does NOT address the "Merge Sorted Array" problem at all. It solves a different problem about removing duplicates while allowing at most 2 duplicates per element. Evaluation:
Final Verdict: NEEDS_IMPROVEMENT The student has solved the wrong problem. They need to implement the merge algorithm using three pointers: one for the end of the valid portion of nums1, one for the end of nums2, and one for the current position to fill in nums1 (starting from the end). The algorithm should compare elements from both arrays and place the larger one at the current position, working backwards to avoid overwriting valid data. VERDICT: NEEDS_IMPROVEMENT Search 2D sorted matrix II (Problem2.cs)
VERDICT: NEEDS_IMPROVEMENT Edit and Remove Duplicates in an array (Problem3.cs)
You need to implement a solution that:
Study the reference solution to understand how to track counts and overwrite elements in-place. VERDICT: NEEDS_IMPROVEMENT |
Completed Two-Pointers-2, please review.