← Goldman Sachs questions

Min flips for alternating string

Filed under Goldman Sachs

Given a binary string s, return the minimum number of character flips (changing '0' to '1' or '1' to '0') required to make s alternating (no two adjacent characters are the same).

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 Goldman Sachs questions

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