- Words without space. For example, abc, def, a, b, c
- Quoted words with or without space. For example, "qwerty asd zxcv", "abc", "a"
- Input: asd def qwe "qwerty asd zxcv" asf "tyuip dfhgdj fgh"
- Output: ['asd', 'def', 'qwe', '"qwerty asd zxcv"', 'asf', '"tyuip dfhgdj fgh"']
- Input: "qwerty asd zxcv"
- Output: ['"qwerty asd zxcv"']
- Input: asd def qwe
- Output: ['asd', 'def', 'qwe']
See solution.py
.
- Time Complexity: O(N*N-1). Given N is the number of characters in the string
- Space Complexity: O(M). Given M is the number of valid word token in an array.