## Minimum Number of Flips to Have Alternating Values - Google Top Interview Questions

You are given a string s containing "1"s and "0"s. You can take some prefix of s and move it to the back. Afterwards, return the minimum number of characters that need to be flipped such that the string never has any two consecutive characters of the same value. Constraints n ≤ 100,000 where n is the length of s Example 1 Input s = "001010111" Output 1 Explanation After we move the first character "0" to the back we get "010101110". Then we can flip the 3rd las

## Minimum Number of Transfers to Settle Debts - Google Top Interview Questions

You are given a two-dimensional list of integers transfers containing [source, dest, amount], which means that person source lent person dest a dollar amount equal to amount. Return the minimum number of person-to-person transfers that are required so that all debts are paid. Constraints n ≤ 13 where n is the number of participants Example 1 Input transfers = [ [0, 1, 50], [1, 2, 50] ] Output 1 Explanation Person 0 gave person 1 \$50 and person 1 gave p

## Moo - Google Top Interview Questions

You are given a string cows representing the initial conditions of some cows. Each cow can take one of three values: "L", meaning the cow is charging to the left. "R", meaning the cow is charging to the right. "@", meaning the cow is standing still. Cows charging on a direction will pick up other cows unless the cow receives a force from the opposite direction. Then, it will stand still. Return the orientation of each cow when the cow stop charging. Constraints