Find the Difference of Two Arrays
Solve this the way you would in the interview: out loud, on a timer, with an AI interviewer asking follow-ups while you code. You get a scored report at the end.
Practice this as a mock interviewFree to start, no account neededProblem
Given two integer arrays nums1 and nums2, return a list answer of exactly two lists:
- answer[0] holds the **distinct** values that appear in nums1 but not in nums2.
- answer[1] holds the **distinct** values that appear in nums2 but not in nums1.
Each inner list must be sorted in ascending order. An inner list is empty when there are no such values.
Examples
Constraints
- 1 <= nums1.length, nums2.length <= 1000
- -1000 <= nums1[i], nums2[i] <= 1000
What the interviewer grades
A correct solution is one of five scores. The report also grades problem understanding (did you clarify inputs and edge cases before coding), problem solving, communication while you work, code quality, and testing. See a sample report, or read up on the pattern in the lessons.