[code jam] Code Jam 2021 Round 1C - Double or NOTing

2021-05-03 Thread XYZT
Hi, I am trying to understand the analysis section for this problem: https://codingcompetitions.withgoogle.com/codejam/round/004362d7/007c1139#analysis The analysis makes the claim: "Let's say there are M bit groups in the suffix we need to create, then we will also need to app

Re: [code jam] Code Jam 2021 Round 1C - Double or NOTing

2021-05-04 Thread Albert Xie
As you can see, we have the new representation for an 01 string that is a sequence of length M whose elements stands for the number of 0s or 1s. For example, you can change 100111 into [1, 2, 3]. If M is odd, then the last bit must be 1, otherwise it must be 0. According to the new representation,