b01b4cbe79 | ||
---|---|---|
.. | ||
__pycache__ | ||
README.md | ||
solution.py |
README.md
How to shuffle the characters in a string in JavaScript ?
e.g. Given "ABCDEFG", return something like "GEFBDCA".
print(shuffle("the quick brown fox jumps over the lazy dog"));
//-> "veolrm hth ke opynug tusbxq ocrad ofeizwj"
print(shuffle("the quick brown fox jumps over the lazy dog"));
//-> "o dt hutpe u iqrxj yaenbwoolhsvmkcger ozf "
- Best performance case: O(n)
- Worst performance case: O(n log n)