- 1
how to count character in the row and column that doesn't have 'a' character
for example input= bbba babb bbbb output=8 input= 12a3 1234 1234 12a3 output= 14 //note= the number that had already be counted in the row can't be counted again in the column
6 Réponses
0
Something like this
https://code.sololearn.com/cXPRpK0d2eT1/?ref=app
0
I'd have two matrices: the input and a boolean. Set the booleans to false. For each row and column, if there isn't an a in it, set the corresponding booleans to true. Count the trues.
0
For each 'a' we need to exclude corresponding row and column.
The answer is character count in the not excluded rows + in the not excluded columns - their intersection (nerow*necolumn).
0
Your example incorrect. Second variant should out 14
- 1
sorry, can someone give me the example code? because i still don't understand about this
- 1
oh thats true hahaha... thanks for the correction