Separate Black and White Balls at Amazon
Medium64.0% acceptance
This problem has 12.5% frequency at Amazon.
Problem Description
There are `n` balls on a table, each ball has a color black or white. You are given a **0-indexed** binary string `s` of length `n`, where `1` and `0` represent black and white balls, respectively. In each step, you can choose two adjacent balls and swap them. Return _the**minimum** number of ste...
Read full problem and hintsTopics
Also asked at 5 companies
More Amazon Questions
Longest Substring Without Repeating CharactersMediumTrapping Rain WaterHardLongest Palindromic SubstringMediumContainer With Most WaterMediumLongest Common PrefixEasy
View all Amazon questions