Flip or Compress FLIPCOMP Solution Codechef

Flip or Compress FLIPCOMP Solution

Flip or Compress FLIPCOMP Solution You are given a binary string SS. You can perform the following operations on SS: Flip: Pick an index ii (1≤i≤|S|)(1≤i≤|S|) and flip the ii-th character (i.e change 11 to 00 or 00 to 11). For e.g. 011–001→010–001011_001→010_001 Compress: Pick any non-empty substring consisting of the same character and replace it with a single occurrence of that character. For e.g. 1001111–––––10→1001–101001111_10→1001_10 You want to make … Read more