Skip to main content
Admissions guidance, study banks, and career tools โ€” get started on Shalyam

Relative Sort Array

Sort arr1 so that elements appear in the order of arr2 (all arr2 elements are in arr1); elements not in arr2 are placed at the end in ascending order.

Constraints

1 <= m <= n <= 1000

Discussion

No discussions yet.

Rewards ยท v2.1

Join Shalyam Newsletter

Get exclusive insights with every issue: education, research and innovation news.

One email a week. Unsubscribe any time.