摘要:
This is my favourite way to iterate through a string. You can do what you want per word.string line = "a line of text to iterate through";string word;... 阅读全文
摘要:
Runtime: O(n) — Moore voting algorithm: We maintain a current candidate and a counter initialized to 0. As we iterate the array, we look at the curren... 阅读全文