← Morgan Stanley questions
CodingReported in a candidate post, Aug 2020

Maximize distance between 1s by flipping m zeros

Filed under Morgan Stanley

Given a binary array consisting of 0s and 1s, find the index of the 0 that, if flipped to 1, maximizes the distance (number of 0s) between consecutive 1s.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Morgan Stanley questions

Collected from public candidate posts and coding forums. Updated Nov 2026.