Strings
A sequence of characters
Time Complexity
- Access: O(1)
- Search: O(n)
- Insert: O(n)
- Remove: O(n)
Look out for in interview
Input character set and case sensitivity. Can we assume lower-case latin characters?
Corner Cases
Techniques
Counting characters: Hashtable/Map
Anagram: It is the result of rearranging the letters of a word or phrase to produce a new word or phrase, while using all the original letters only once. Count frequency of characters.
Palindrome: Reads the same forwards and backwards. Use Two Pointers approach.