Restore an Array with One Displaced Element

Quick Overview

Restore a nearly sorted array after at most one element was removed and reinserted elsewhere. The problem tests linear-time reasoning, constant auxiliary-space goals, duplicates, negative values, already-sorted input, and boundary cases without mutating the caller's array.

Restore an Array with One Displaced Element

Company: Glean

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

Overview: Restore a nearly sorted array after at most one element was removed and reinserted elsewhere. The problem tests linear-time reasoning, constant auxiliary-space goals, duplicates, negative values, already-sorted input, and boundary cases without mutating the caller's array.

|Home/Coding & Algorithms/Glean
Glean logo
Glean
Jul 2, 2026
mediumSoftware EngineerTechnical ScreenCoding & Algorithms
6
0
Loading...

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...