Quick Overview

Merge two nondecreasing integer arrays into a new sorted array while preserving every duplicate. Apply the two-pointer technique for linear time and output-sized space, including empty inputs and equal values, without mutating either source array.

Merge Two Sorted Arrays

Company: Whatnot

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: hard

Interview Round: Technical Screen

Overview: Merge two nondecreasing integer arrays into a new sorted array while preserving every duplicate. Apply the two-pointer technique for linear time and output-sized space, including empty inputs and equal values, without mutating either source array.

Loading…