Problem of the Day
A new programming or logic puzzle every Mon-Fri

Bit Flipping

This one may prove to be a bit of a toughy. Given an array consisting of 0s and 1s, determine a grouping that flipping all the numbers in that group would cause the array to contain the most amount of 1s. The function should then return the number of 1s in that array.


//Flips to [1,1,1,0,1,1,1]

>> 6



  • There are currently no comments. You can be first!

Content curated by @MaxBurstein