String Without 3 Identical Consecutive Letters - Company-specific OAs / Microsoft OA

The Python solution has O(N^2) time complexity because Python string is immutable so the code needs to construct a new string (O(N) runtime) for every loop (of the N loop). N is the number of characters. It would be better to use an array of character then join them in the end.