New answers tagged

8 votes

Minimum number of flips needed to fully set a binary string

This is a refinement of @Retudin's very nice invariant which makes it easy to calculate the required number of flips in linear time: Given a binary string, for example, ...
loopy walt's user avatar
8 votes
Accepted

Minimum number of flips needed to fully set a binary string

Find a good invariant You need to see if if you can work towards the solution To find the number of flips needed:
Retudin's user avatar
  • 8,364
0 votes

Minimum number of flips needed to fully set a binary string

Which strings can be brought to all-1s? How do you optimally solve a string? How many moves will this take?
AxiomaticSystem's user avatar

Top 50 recent answers are included