String Builder
String is immutable, meaning you can't change it once created. When you concatenate two strings, it doesn’t simply add one string at the end of another; it creates a new string (ouch). Use a StringBuilder instead (or string.join() on a list in Python), which essentially is a List<Character>.
· String += c → linear
· StringBuilder.append(c) → constant
LeetCode
1119. Remove Vowels from a String
Python | Java
-
https://leetcode.com/problems/remove-vowels-from-a-string/
https://leetcode.com/problems/reverse-words-in-a-string/
https://leetcode.com/problems/unique-email-addresses/
https://leetcode.com/problems/repeated-dna-sequences/
https://leetcode.com/problems/decode-string/
https://leetcode.com/problems/custom-sort-string/
https://leetcode.com/problems/add-strings/
https://leetcode.com/problems/add-binary/
https://leetcode.com/problems/largest-number/