Wouldn’t this code fail in a case like this? Because you count different lines, not different characters in the lines, right? Or am I missing something? Thanks (Let’s ignore column symmetry for the sake of example).
##
..
..
..
(I think you will get answer 100, but the answer is 300)
But for sure after seeing this I have to learn Scala.
Oh, I see, I for some reason switched zip operation with “create pair/tuple” operation in my head. Thanks for clarification.