Intersection of Two Arrays
Updated Feb 24, 2026
Problem
Return unique intersection in sorted order.
Constraints
1 <= nums1.length, nums2.length <= 1000
Examples
Example 1
Input:
{"nums1": [1, 2, 2, 1], "nums2": [2, 2]}
Output:
[2]
Function Signature
def intersection(self, nums1: list[int], nums2: list[int]) -> list[int]
How to Submit
Implement a Solution class with a intersection method.
Your method will be called with the input parameters and should return the answer.