Given a character matrix in which some of the cells have alphabets written on them while other cells are empty (empty cells contains character ‘-‘ in them). For example consider the below matrix: A – – – B – – – C All characters are unique. Set character on all empty cells in such a […]

Given a string of bits and a number k. In one flip, you can toggle k consecutive characters, how many flips are required to change the entire string to all ones. For example Input String: 0000110000 k: 3 OUTPUT: 4 Following are the four flips: FLIP-1: 1110110000 FLIP-2: 1110110111 FLIP-3: 1111000111 FLIP-4: 1111111111 If it is not possible […]