VassarLabs interview question

1.character count in O(n) time complexity