Start a new Kumite
AllAgda (Beta)BF (Beta)CCFML (Beta)ClojureCOBOL (Beta)CoffeeScriptCommonLisp (Beta)CoqC++CrystalC#D (Beta)DartElixirElm (Beta)Erlang (Beta)Factor (Beta)Forth (Beta)Fortran (Beta)F#GoGroovyHaskellHaxe (Beta)Idris (Beta)JavaJavaScriptJulia (Beta)Kotlinλ Calculus (Beta)LeanLuaNASMNim (Beta)Objective-C (Beta)OCaml (Beta)Pascal (Beta)Perl (Beta)PHPPowerShell (Beta)Prolog (Beta)PureScript (Beta)PythonR (Beta)RacketRaku (Beta)Reason (Beta)RISC-V (Beta)RubyRustScalaShellSolidity (Beta)SQLSwiftTypeScriptVB (Beta)
Show only mine

Kumite (ko͞omiˌtā) is the practice of taking techniques learned from Kata and applying them through the act of freestyle sparring.

You can create a new kumite by providing some initial code and optionally some test cases. From there other warriors can spar with you, by enhancing, refactoring and translating your code. There is no limit to how many warriors you can spar with.

A great use for kumite is to begin an idea for a kata as one. You can collaborate with other code warriors until you have it right, then you can convert it to a kata.

Ad
Ad
Code
Diff
  • def prime_factorization(n):
        factors = []
        cnt = 0
        while n % 2 == 0: cnt += 1; n //= 2
        if cnt: factors.append((2, cnt))
        i = 3
        while i * i <= n:
            cnt = 0
            while n % i == 0: cnt += 1; n //= i
            if cnt: factors.append((i, cnt))
            i += 2
        if n > 1: factors.append((n, 1))
        return factors
    • def prime_factorization(n):
    • factors = []
    • cnt = 0
    • while n % 2 == 0: cnt += 1; n //= 2
    • if cnt: factors.append((2, cnt))
    • cnt = 0
    • while n % 3 == 0: cnt += 1; n //= 3
    • if cnt: factors.append((3, cnt))
    • i = 5
    • i = 3
    • while i * i <= n:
    • cnt = 0
    • while n % i == 0: cnt += 1; n //= i
    • if cnt: factors.append((i, cnt))
    • cnt = 0
    • i += 2
    • while n % i == 0: cnt += 1; n //= i
    • if cnt: factors.append((i, cnt))
    • i += 4
    • if n > 1: factors.append((n, 1))
    • return factors
Code
Diff
  • import zlib
    l='L1'
    exec(str(zlib.decompress(bytes("xÚMP=oÂ0ý+¯YXC[u@B,•h§v©ÄâØpqìÈw.Eÿ½—€DåÅzw÷¾„~eL×8·ª±Í¾Ÿ\"ªº_UØ1HÛÒy!³‚™¤äXÕ¬>wM\nŒj‰¶Ú¤®ÏČ`òž ʎ9wI-äàyè/>‚;lr´ØÅÏ+¬;Ãx~yxÜyBð‘jœ¼Rˆ—@|¥V 8œrRCm‰v´[ù2IL¢5½9ߗ‚»’ë`–'zbä~·À‡ïú@àÊÔÂ߅e$ßUããT²½&»¼§Lc¦,ø1ٛ(ð¼„KPìˆÔ\nEœRvЀܓõ&¨Ù£t£~C­©’–òšNÿZ‚5QÇklÌäý½uí­q÷k¼‘Ìö@ö/Õ¸ª",encoding=l)),l))
    • text=lambda d="description ",k=" Kata or Kumite ",r=" return",s=" symbols ": f"Compress large text - {d}of this{k}in small code.\nThis{k}{d}has 462{s}in 3 line, without title. You should wrote function,{r} this text, but you should use less{s}in you'r code that this text. Simple solution - just{r} \"\"\"source text\"\"\". More smart variant is: do mark often word as special{s}and replace his before{r}.\nHow small code can be? Can you wrote more compressing? Let's check it!"
    • import zlib
    • l='L1'
    • exec(str(zlib.decompress(bytes("xÚMP=oÂ0ý+¯YXC[u@B ,•h§v©ÄâØpqìÈw.Eÿ½—€DåÅzw÷¾„~eL×8·ª±Í¾Ÿ\"ªº_UØ1HÛÒy!³‚™¤äXÕ¬>wM\nŒj‰¶Ú¤®ÏČ`òž ʎ9wI-äàyè/>‚;lr´ØÅÏ+¬;Ãx~yxÜyBð‘jœ¼Rˆ—@ |¥V 8œrRCm‰v´[ù2IL¢5½9ߗ ‚»’ë`–'zbä~·À‡ïú@àÊÔÂ߅e$ßUããT²½&» ¼§Lc¦,ø1ٛ(ð¼„KPìˆÔ\nEœRvЀܓõ&¨Ù£t£~C­©’–òšNÿZ‚5QÇklÌäý½uí­q÷k¼‘Ìö@ö/Õ¸ª",encoding=l)),l))
Code
Diff
  • s=lambda a,b:a-b
    • from operator import sub as s
    • s=lambda a,b:a-b
Fundamentals
Mathematics

lambda, more concise :)

Code
Diff
  • m=lambda a,b:a*b
    • def m(a,b):return a*b
    • m=lambda a,b:a*b