among us
amongus
amoügsu
amogus
def is_sussy(s):
try:
i=0
target="sus"
while i<len(s)-len(target)+1:
if s[i:i+len(target)].lower()==target:
return "sus"
i+=1
return "not sus"
except:
return "ඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞ"
import codewars_test as test
# TODO Write tests
import solution # or from solution import example
# test.assert_equals(actual, expected, [optional] message)
@test.describe("Example")
def test_group():
@test.it("test case")
def test_case():
test.assert_equals(1 + 1, 2)
test.assert_equals(is_sussy("sus"), "sus")
test.assert_equals(is_sussy("poodle"), "not sus")
ඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞ
def sus(): acc=[];s="sus";ss="sussy";sss="amogus";i=0 def among(): nonlocal acc;nonlocal s;nonlocal i;nonlocal ss;nonlocal sss;acc.append(s if i%5 else ss if i%3 else sss);i+=1 return " ".join(acc) return among
- def sus():
acc=[];s="sus";ss="sussy";i=0- acc=[];s="sus";ss="sussy";sss="amogus";i=0
- def among():
nonlocal acc;nonlocal s;nonlocal i;nonlocal ss;acc.append(s if i%3 else ss);i+=1- nonlocal acc;nonlocal s;nonlocal i;nonlocal ss;nonlocal sss;acc.append(s if i%5 else ss if i%3 else sss);i+=1
- return " ".join(acc)
- return among
import codewars_test as suss # ඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞ import solution # ඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞ # ඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞ @suss.describe("sus") def susss(): @suss.it("sus") def among_us(): red=sus() suss.assert_equals(red(),"amogus") suss.assert_equals(red(),"amogus sus") suss.assert_equals(red(),"amogus sus sus") suss.assert_equals(red(),"amogus sus sus sus") suss.assert_equals(red(),"amogus sus sus sus sus") suss.assert_equals(red(),"amogus sus sus sus sus sussy")
import codewars_test as test# TODO Write testsimport solution # or from solution import example# test.assert_equals(actual, expected, [optional] message)@test.describe("Example")def test_group():@test.it("test case")def test_case():test.assert_equals(1 + 1, 2)- import codewars_test as suss
- # ඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞ
- import solution # ඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞ
- # ඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞ
- @suss.describe("sus")
- def susss():
- @suss.it("sus")
- def among_us():
- red=sus()
test.assert_equals(red(),"sussy")test.assert_equals(red(),"sussy sus")test.assert_equals(red(),"sussy sus sus")- suss.assert_equals(red(),"amogus")
- suss.assert_equals(red(),"amogus sus")
- suss.assert_equals(red(),"amogus sus sus")
- suss.assert_equals(red(),"amogus sus sus sus")
- suss.assert_equals(red(),"amogus sus sus sus sus")
- suss.assert_equals(red(),"amogus sus sus sus sus sussy")
closuredsus
closused
closurussed
clossussed
closussuss
sus
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣤⣤⣤⣤⣤⣶⣦⣤⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⡿⠛⠉⠙⠛⠛⠛⠛⠻⢿⣿⣷⣤⡀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⠋⠀⠀⠀⠀⠀⠀⠀⢀⣀⣀⠈⢻⣿⣿⡄⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⣸⣿⡏⠀⠀⠀⣠⣶⣾⣿⣿⣿⠿⠿⠿⢿⣿⣿⣿⣄⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⣿⣿⠁⠀⠀⢰⣿⣿⣯⠁⠀⠀⠀⠀⠀⠀⠀⠈⠙⢿⣷⡄⠀
⠀⠀⣀⣤⣴⣶⣶⣿⡟⠀⠀⠀⢸⣿⣿⣿⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣷⠀
⠀⢰⣿⡟⠋⠉⣹⣿⡇⠀⠀⠀⠘⣿⣿⣿⣿⣷⣦⣤⣤⣤⣶⣶⣶⣶⣿⣿⣿⠀
⠀⢸⣿⡇⠀⠀⣿⣿⡇⠀⠀⠀⠀⠹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠃⠀
⠀⣸⣿⡇⠀⠀⣿⣿⡇⠀⠀⠀⠀⠀⠉⠻⠿⣿⣿⣿⣿⡿⠿⠿⠛⢻⣿⡇⠀⠀
⠀⣿⣿⠁⠀⠀⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣧⠀⠀
⠀⣿⣿⠀⠀⠀⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⠀⠀
⠀⣿⣿⠀⠀⠀⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⠀⠀
⠀⢿⣿⡆⠀⠀⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⡇⠀⠀
⠀⠸⣿⣧⡀⠀⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⠃⠀⠀
⠀⠀⠛⢿⣿⣿⣿⣿⣇⠀⠀⠀⠀⠀⣰⣿⣿⣷⣶⣶⣶⣶⠶⠀⢠⣿⣿⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⣿⣿⠀⠀⠀⠀⠀⣿⣿⡇⠀⣽⣿⡏⠁⠀⠀⢸⣿⡇⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⣿⣿⠀⠀⠀⠀⠀⣿⣿⡇⠀⢹⣿⡆⠀⠀⠀⣸⣿⠇⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⢿⣿⣦⣄⣀⣠⣴⣿⣿⠁⠀⠈⠻⣿⣿⣿⣿⡿⠏⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠈⠛⠻⠿⠿⠿⠿⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
def sus():
acc=[];s="sus";ss="sussy";i=0
def among():
nonlocal acc;nonlocal s;nonlocal i;nonlocal ss;acc.append(s if i%3 else ss);i+=1
return " ".join(acc)
return among
import codewars_test as test
# TODO Write tests
import solution # or from solution import example
# test.assert_equals(actual, expected, [optional] message)
@test.describe("Example")
def test_group():
@test.it("test case")
def test_case():
test.assert_equals(1 + 1, 2)
red=sus()
test.assert_equals(red(),"sussy")
test.assert_equals(red(),"sussy sus")
test.assert_equals(red(),"sussy sus sus")
pyramid_of_x = lambda _: 'Not enough building blocks!' if _<True+True else '\n'.join(['*' * _ for _ in range(True, _ + True)])
def pyramid_of_x(n):if n < 2:return 'Not enough building blocks!'rows = ['*' * i for i in range(1, n + 1)]return '\n'.join(rows)- pyramid_of_x = lambda _: 'Not enough building blocks!' if _<True+True else '\n'.join(['*' * _ for _ in range(True, _ + True)])
sussy kumite
⣿⣿⣿⣿⣿⣿⣿⣿⠟⠋⠁⠄⠄⠄⠄⠄⠄⠄⠄⠙⢿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⡟⠁⠄⠄⠄⠄⣠⣤⣴⣶⣶⣶⣶⣤⡀⠈⠙⢿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⡟⠄⠄⠄⠄⠄⣸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣆⠄⠈⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⠁⠄⠄⠄⢀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠄⠄⢺⣿⣿⣿⣿
⣿⣿⣿⣿⣿⡄⠄⠄⠄⠙⠻⠿⣿⣿⣿⣿⠿⠿⠛⠛⠻⣿⡄⠄⣾⣿⣿⣿⣿
⣿⣿⣿⣿⣿⡇⠄⠄ ⢹⣿⡗ ⡀⣾⢀⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⡇⠘⠄⠄⠄⢀⡀⠄⣿⣿⣷⣤⣤⣾⣿⣿⣿⣧⢸⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⡇⠄⣰⣿⡿⠟⠃⠄⣿⣿⣿⣿⣿⡛⠿⢿⣿⣷⣾⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⡄⠈⠁⠄⠄⠄⠄⠻⠿⢛⣿⣿⠿⠂⠄⢹⢹⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⡐⠐⠄ ⣰⠄⠞⣾⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣷⡄⠄⠄ ⢠⣿⣎⣾⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⡿⠟⠛⠄⠄⠄ . ⣵⣿⡿⢹⡟⣿⣿⣿⣿⣿⣿⣿
⣿⠿⠿⠋⠉⠄⠄⠄⠄⠄⠄⠄⣀⣠⣾⣿⣿⣿⡟⠁⠹⡇⣸⣿⣿⣿⣿⣿⣿
⠁⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠙⠿⠿⠛⠋⠄⣸⣦⣠⣿⣿⣿⣿⣿⣿⣿
sus=list
Sus=set
suS=tuple
SuS=sorted
def among(us):
return tuple(sus(us)+SuS(Sus(us)))
amon="\
⣿⣿⣿⣿⣿⣿⣿⣿⠟⠋⠁⠄⠄⠄⠄⠄⠄⠄⠄⠙⢿⣿⣿⣿⣿⣿⣿⣿⣿\n\
⣿⣿⣿⣿⣿⣿⡟⠁⠄⠄⠄⠄⣠⣤⣴⣶⣶⣶⣶⣤⡀⠈⠙⢿⣿⣿⣿⣿⣿\n\
⣿⣿⣿⣿⣿⡟⠄⠄⠄⠄⠄⣸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣆⠄⠈⣿⣿⣿⣿⣿\n\
⣿⣿⣿⣿⣿⠁⠄⠄⠄⢀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠄⠄⢺⣿⣿⣿⣿\n\
⣿⣿⣿⣿⣿⡄⠄⠄⠄⠙⠻⠿⣿⣿⣿⣿⠿⠿⠛⠛⠻⣿⡄⠄⣾⣿⣿⣿⣿\n\
⣿⣿⣿⣿⣿⡇⠄⠄ ⢹⣿⡗ ⡀⣾⢀⣿⣿⣿⣿⣿⣿\n\
⣿⣿⣿⣿⣿⡇⠘⠄⠄⠄⢀⡀⠄⣿⣿⣷⣤⣤⣾⣿⣿⣿⣧⢸⣿⣿⣿⣿⣿\n\
⣿⣿⣿⣿⣿⡇⠄⣰⣿⡿⠟⠃⠄⣿⣿⣿⣿⣿⡛⠿⢿⣿⣷⣾⣿⣿⣿⣿⣿\n\
⣿⣿⣿⣿⣿⣿⡄⠈⠁⠄⠄⠄⠄⠻⠿⢛⣿⣿⠿⠂⠄⢹⢹⣿⣿⣿⣿⣿⣿\n\
⣿⣿⣿⣿⣿⣿⣿⡐⠐⠄ ⣰⠄⠞⣾⣿⣿⣿⣿⣿⣿\n\
⣿⣿⣿⣿⣿⣿⣿⣷⡄⠄⠄ ⢠⣿⣎⣾⣿⣿⣿⣿⣿⣿⣿\n\
⣿⣿⣿⣿⣿⣿⡿⠟⠛⠄⠄⠄ . ⣵⣿⡿⢹⡟⣿⣿⣿⣿⣿⣿⣿\n\
⣿⠿⠿⠋⠉⠄⠄⠄⠄⠄⠄⠄⣀⣠⣾⣿⣿⣿⡟⠁⠹⡇⣸⣿⣿⣿⣿⣿⣿\n\
⠁⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠙⠿⠿⠛⠋⠄⣸⣦⣠⣿⣿⣿⣿⣿⣿⣿\n"
import codewars_test as sus
# TODO sus
import solution # sus
print(amon)
# sus
@sus.describe("Example")
def sussy():
@sus.it("test case")
def suss():
sus.assert_equals(1 + 1, 2)
sus.assert_equals(among("12"),('1', '2', '1', '2'))
sus.assert_equals(among("sus"),('s', 'u', 's', 's','u'))
speech, except it is sussy
given a string of single space separated "words",
return the string except sustified
susified?
sussed?
idk
. ’ . : . ● . *: . ‘
‘ : * . * . * ’ . : ’
______𐐘𐑀 ____________
🌑🌑🌑🌑🌑🌑🌑🌑🌑🌑🌑 🌑🌑🌑🌔🌕🌕🌕🌘🌑🌑🌑 🌑🌑🌓🌕🌕🌕🌕🌕🌗🌑🌑 🌑🌑🌔🌕🌘🌑🌒🌕🌗🌑🌑 🌑🌑🌕🌘🌑🌑🌑🌒🌖🌑🌑 🌑🌒🌕🌕🌘🌑🌒🌕🌕🌑🌑 🌑🌒🌕🌕🌕🌕🌕🌕🌕🌑🌑 🌑🌒🌕🌕🌕🌕🌕🌕🌕🌑🌑 🌑🌒🌕🌕🌕🌖🌕🌕🌕🌑🌑 🌑🌒🌕🌕🌗🌑🌓🌕🌕🌑🌑 🌒🌕🌕🌕🌗🌔🌕🌕🌕🌑🌑 🌑🌑🌑🌑🌑🌑🌑🌑🌑🌑🌑
susify = lambda _: " ".join(map(lambda _:_+"sussy" if _[-1].lower() in "aeiou" else _+"ussy",_.split(" ")))
import codewars_test as test
# TODO Write tests
import solution # or from solution import example
# test.assert_equals(actual, expected, [optional] message)
@test.describe("Example")
def test_group():
@test.it("test case")
def test_case():
test.assert_equals(1 + 1, 2)
test.assert_equals(susify("among us"), "amongussy usussy")
test.assert_equals(susify("amongus"), "amongusussy")
test.assert_equals(susify("a apple"), "asussy applesussy")
elf
def elf(s):
"santa"
pass
import codewars_test as test
# TODO Write tests
import solution # or from solution import example
# test.assert_equals(actual, expected, [optional] message)
@test.describe("Example")
def test_group():
@test.it("test case")
def test_case():
test.assert_equals(1 + 1, 2)
test.assert_equals("sa"+"nta", "santa")
experiment=""
def ad(a,b):
return (a & b, a ^ b)
import codewars_test as test
# TODO Write tests
import solution # or from solution import example
# test.assert_equals(actual, expected, [optional] message)
@test.describe("Example")
def test_group():
@test.it("test case")
def test_case():
test.assert_equals(1 + 1, 2)
delicious marina sauce
def l():
return "Did you ever hear the tragedy of Darth Plagueis The Wise? I thought not. It’s not a story the Jedi would tell you. It’s a Sith legend. Darth Plagueis was a Dark Lord of the Sith, so powerful and so wise he could use the Force to influence the midichlorians to create life… He had such a knowledge of the dark side that he could even keep the ones he cared about from dying. The dark side of the Force is a pathway to many abilities some consider to be unnatural. He became so powerful… the only thing he was afraid of was losing his power, which eventually, of course, he did. Unfortunately, he taught his apprentice everything he knew, then his apprentice killed him in his sleep. Ironic. He could save others from death, but not himself."
import codewars_test as test
# TODO Write tests
import solution # or from solution import example
# test.assert_equals(actual, expected, [optional] message)
@test.describe("Example")
def test_group():
@test.it("test case")
def test_case():
test.assert_equals(1 + 1, 2)
test.assert_equals(l(),"Did you ever hear the tragedy of Darth Plagueis The Wise? I thought not. It’s not a story the Jedi would tell you. It’s a Sith legend. Darth Plagueis was a Dark Lord of the Sith, so powerful and so wise he could use the Force to influence the midichlorians to create life… He had such a knowledge of the dark side that he could even keep the ones he cared about from dying. The dark side of the Force is a pathway to many abilities some consider to be unnatural. He became so powerful… the only thing he was afraid of was losing his power, which eventually, of course, he did. Unfortunately, he taught his apprentice everything he knew, then his apprentice killed him in his sleep. Ironic. He could save others from death, but not himself.")
less space but slow
//Given 2 Arrays, Return True if arrays contain common item, else false. //e.g a= ['a','b','g','c'] and b =['z','e','c'] returns true //input : 2 arrays //output: bool using System.Collections.Generic; using System.Linq; public class Kata { public static bool ContainsCommonItem(char[] a, char[] b) { if (a==null ||b==null){ return false; } for (int i = 0; i < a.Length; i++) { for (int j=0; j<b.Length; j++){ if (a[i]==b[j]){ return true; } } } return false; } }
- //Given 2 Arrays, Return True if arrays contain common item, else false.
- //e.g a= ['a','b','g','c'] and b =['z','e','c'] returns true
- //input : 2 arrays
- //output: bool
- using System.Collections.Generic;
- using System.Linq;
- public class Kata
- {
- public static bool ContainsCommonItem(char[] a, char[] b)
- {
return a != null ? b != null ? new List<char>(a).Intersect(new List<char>(b)).Count() > 0 : false: false;- if (a==null ||b==null){
- return false;
- }
- for (int i = 0; i < a.Length; i++)
- {
- for (int j=0; j<b.Length; j++){
- if (a[i]==b[j]){
- return true;
- }
- }
- }
- return false;
- }
- }
def where(thing="codewar",home="home",food="doorito",phone="phone"): return f"where were u wen {thing} die?\ni was at {home} eatin {food} wen {phone} ring\n\"{thing} is kil\"\n\"no\"" pass
i_was_at_home_makin_kumite = lambda when_phone_ring: Nonedef codewar_is_kil(no):- def where(thing="codewar",home="home",food="doorito",phone="phone"):
- return f"where were u wen {thing} die?\ni was at {home} eatin {food} wen {phone} ring\n\"{thing} is kil\"\n\"no\""
- pass
import codewars_test as test # TODO Write tests import solution # or from solution import example print(where()) print(where("Club penguin",home="house",food="dorito")) # test.assert_equals(actual, expected, [optional] message) @test.describe("Example") def test_group(): @test.it("test case") def test_case(): test.assert_equals(1 + 1, 2)
- import codewars_test as test
- # TODO Write tests
- import solution # or from solution import example
- print(where())
- print(where("Club penguin",home="house",food="dorito"))
- # test.assert_equals(actual, expected, [optional] message)
- @test.describe("Example")
- def test_group():
- @test.it("test case")
- def test_case():
- test.assert_equals(1 + 1, 2)
i_was_at_home_makin_kumite = lambda when_phone_ring: None
def codewar_is_kil(no):
pass
import codewars_test as test
# TODO Write tests
import solution # or from solution import example
# test.assert_equals(actual, expected, [optional] message)
@test.describe("Example")
def test_group():
@test.it("test case")
def test_case():
test.assert_equals(1 + 1, 2)
def rec(pre,post,st): if pre==[]: st.add(tuple(post)) return else: i=0 while i<len(pre): rec(pre[0:i]+pre[i+1:],[pre[i]]+post,st) i+=1 return def all_permutations(lst): s=set() rec(lst,[],s) return s
from itertools import permutationsall_permutations = lambda lst: list(permutations(lst))- def rec(pre,post,st):
- if pre==[]:
- st.add(tuple(post))
- return
- else:
- i=0
- while i<len(pre):
- rec(pre[0:i]+pre[i+1:],[pre[i]]+post,st)
- i+=1
- return
- def all_permutations(lst):
- s=set()
- rec(lst,[],s)
- return s
import codewars_test as test # TODO Write tests import solution # or from solution import example # test.assert_equals(actual, expected, [optional] message) @test.describe("Example") def test_group(): @test.it("test case") def test_case(): test.assert_equals(all_permutations([1, 2, 3]), {(1, 2, 3), (1, 3, 2), (2, 1, 3), (2, 3, 1), (3, 1, 2), (3, 2, 1)}) test.assert_equals(all_permutations([1, 2]), {(1, 2), (2, 1)}) test.assert_equals(all_permutations([1]), {(1,)}) test.assert_equals(all_permutations([]), {()}) test.assert_equals(all_permutations(['w', 'i', 'n']), {('w', 'i', 'n'), ('w', 'n', 'i'), ('i', 'w', 'n'), ('i', 'n', 'w'), ('n', 'w', 'i'), ('n', 'i', 'w')})
- import codewars_test as test
- # TODO Write tests
- import solution # or from solution import example
- # test.assert_equals(actual, expected, [optional] message)
- @test.describe("Example")
- def test_group():
- @test.it("test case")
- def test_case():
test.assert_equals(all_permutations([1, 2, 3]), [(1, 2, 3), (1, 3, 2), (2, 1, 3), (2, 3, 1), (3, 1, 2), (3, 2, 1)])test.assert_equals(all_permutations([1, 2]), [(1, 2), (2, 1)])test.assert_equals(all_permutations([1]), [(1,)])test.assert_equals(all_permutations([]), [()])test.assert_equals(all_permutations(['w', 'i', 'n']), [('w', 'i', 'n'), ('w', 'n', 'i'), ('i', 'w', 'n'), ('i', 'n', 'w'), ('n', 'w', 'i'), ('n', 'i', 'w')])- test.assert_equals(all_permutations([1, 2, 3]), {(1, 2, 3), (1, 3, 2), (2, 1, 3), (2, 3, 1), (3, 1, 2), (3, 2, 1)})
- test.assert_equals(all_permutations([1, 2]), {(1, 2), (2, 1)})
- test.assert_equals(all_permutations([1]), {(1,)})
- test.assert_equals(all_permutations([]), {()})
- test.assert_equals(all_permutations(['w', 'i', 'n']), {('w', 'i', 'n'), ('w', 'n', 'i'), ('i', 'w', 'n'), ('i', 'n', 'w'), ('n', 'w', 'i'), ('n', 'i', 'w')})
def binary(n):
acc=[]
while n:
if n%2:
acc=["1"]+acc
else:
acc=["0"]+acc
n=n//2
return "".join(acc)
import codewars_test as test
# TODO Write tests
import solution # or from solution import example
# test.assert_equals(actual, expected, [optional] message)
@test.describe("Example")
def test_group():
@test.it("test case")
def test_case():
test.assert_equals(1 + 1, 2)
test.assert_equals(binary(87), bin(87)[2:])
def value(s):
curr=2**(len(s)-1)
i=0
acc=0
while i<len(s):
if s[i]=="1":
acc+=curr
curr=curr//2
i+=1
return acc
import codewars_test as test
# TODO Write tests
import solution # or from solution import example
# test.assert_equals(actual, expected, [optional] message)
@test.describe("Example")
def test_group():
@test.it("test case")
def test_case():
test.assert_equals(1 + 1, 2)
test.assert_equals(value("101"), 5)