19
Last seen 2 years ago
Member for 11 years, 4 months, 12 days
Difficulty Normal
I like the trick used for detecting first letter - `s.index(i)`
More
```
yield sorted_suffix[region_index]
sorted_suffix.pop(region_index)
````
shorter version
```
yield sorted_suffix.pop(region_index)
```
More
You can use range iterator instead of while - then you can omit the `try`
I like that you are doing it in-place
More
You do not have to use `len` array with and would be typed to boolean
More
I do worry that Counter is created in each iteration
More
nice solution, I would return directly instead of using status variable and
the else branch is not doing anything
More
You can also go over the words (split by whitespaces and special chars) and search for them in the set, that should be O(n).
More
you can do slice of the array with 1 or 2 elements (`len(data) + 1 / 2` and `len(data) + 1 // 2` - boundaries) and then divide it by the len of the slice. IMHO it would be cleaner.
More