This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def is_smaller(one, two): | |
one_sorted = sorted(one) | |
one_freq = [one.count(l) for l in sorted(set(one_sorted))] | |
two_sorted = sorted(two) | |
two_freq = [two.count(l) for l in sorted(set(two_sorted))] | |
for oc, tc in zip(one_freq, two_freq): | |
if oc != tc: | |
return oc - tc < 0 | |
return False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"workbench.colorTheme": "Material Spacegray", | |
"extensions.ignoreRecommendations": true, | |
"workbench.fontAliasing": "antialiased", | |
"workbench.statusBar.visible": false, | |
"breadcrumbs.enabled": false, | |
"editor.minimap.enabled": false, | |
"editor.lineNumbers": "relative", | |
"editor.matchBrackets": "never", | |
"editor.parameterHints.enabled": false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from threading import Thread | |
def threaded(func): | |
""" | |
Decorator that multithreads the target function | |
with the given parameters. Returns the thread | |
created for the function | |
""" | |
def wrapper(*args, **kwargs): |