Retired

Coin Flipper (retired)

Description:

You're given an M * N matrix of coins, some flipped to heads, some tails. And you want to make it so they are all heads. For example:

H T H
T H H
T H T

You have one available operation: flip(row,column). This function flips every coin from index [0,0] to [row,column] inclusive and returns the resulting matrix. So if flip(1,1) were applied to the matrix above, the result would be:

T H H
H T H
T H T

The target for this example would be:

H H H
H H H
H H H

Coin values are stored as booleans, for simplicity.

Your function shouldn't return anything. It's not necessary to minimize the number of flips. Again, remember flip returns the new matrix.

Fundamentals

Similar Kata:

More By Author:

Check out these other kata created by grensley

Stats:

CreatedDec 6, 2016
Warriors Trained32
Total Skips0
Total Code Submissions52
Total Times Completed9
Python Completions9
Total Stars2
% of votes with a positive feedback rating13% of 4
Total "Very Satisfied" Votes0
Total "Somewhat Satisfied" Votes1
Total "Not Satisfied" Votes3
Total Rank Assessments2
Average Assessed Rank
6 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • grensley Avatar
Ad