This solution doesn't work if there are duplicates. For instance, if word = 'SoS', then capitals(word) == [0, 0].
Loading collection data...
This solution doesn't work if there are duplicates. For instance, if word = 'SoS', then capitals(word) == [0, 0].