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
  • binary_to_integer = lambda n: int(n, 2)
    • def binary_to_integer(b):
    • return sum([x[0] for x in list(zip([pow(2,i) for i in range(len(b))], reversed(b))) if x[1] == '1'])
    • binary_to_integer = lambda n: int(n, 2)
Code
Diff
  • import java.util.Arrays;
    import java.util.HashSet;
    
    class Solution {
    
      static int similarPairs(String[] words) {
        var seenWords = new HashSet<String>(Arrays.asList(words));
        return words.length - seenWords.size();
      }
    
    }
    • import static java.util.Collections.addAll;
    • import java.util.Arrays;
    • import java.util.HashSet;
    • class Solution {
    • static int similarPairs(String[] words) {
    • var seenWords = new HashSet<String>(words.length);
    • addAll(seenWords, words);
    • var seenWords = new HashSet<String>(Arrays.asList(words));
    • return words.length - seenWords.size();
    • }
    • }
Code
Diff
  • USING: kernel parser sequences quotations prettyprint fry ;
    QUALIFIED-WITH: tools.testest tt
    IN: testest.extras
    
    
    : wrap-it ( quot -- wrapped )
      '[ tt:it#{ _ dip tt:}# ] ;
      
    : wrap-describe ( quot -- wrapped )
      '[ tt:describe#{ _ dip tt:}# ] ;
    
    SYNTAX: it#{ \ tt:}# parse-until >quotation wrap-it append! ;
    SYNTAX: describe#{ \ tt:}# parse-until >quotation wrap-describe append! ;
    
    
    • USING: kernel parser sequences quotations prettyprint fry ;
    • QUALIFIED-WITH: tools.testest tt
    • IN: testest.extras
    • : wrap-it ( quot -- wrapped )
    • '[ tt:it#{ _ dip tt:}# ] ;
    • : wrap-describe ( quot -- wrapped )
    • '[ tt:describe#{ _ dip tt:}# ] ;
    • SYNTAX: it#{ \ tt:}# parse-until >quotation wrap-it suffix! \ call suffix! ;
    • SYNTAX: describe#{ \ tt:}# parse-until >quotation wrap-describe suffix! \ call suffix! ;
    • SYNTAX: it#{ \ tt:}# parse-until >quotation wrap-it append! ;
    • SYNTAX: describe#{ \ tt:}# parse-until >quotation wrap-describe append! ;
Code
Diff
  • function numMinusSeven(num) {
        return (num-num%7)/7+1
    }
    
    • function numMinusSeven(num) {
    • let aaaaaaaaaaaaaaaaaa = []
    • while (num > 0) {
    • num -= 7
    • aaaaaaaaaaaaaaaaaa.push(num)
    • }
    • return aaaaaaaaaaaaaaaaaa.length
    • return (num-num%7)/7+1
    • }
Code
Diff
  • const addArr = (arr) => arr.length<=0?null:arr.reduce((a,b)=>a+b);
    
    • const addArr = (arr) => {
    • let sum = 0;
    • for (let i = 0; i < arr.length; i++) {
    • sum += arr[i];
    • }
    • return sum || null;
    • };
    • const addArr = (arr) => arr.length<=0?null:arr.reduce((a,b)=>a+b);
Code
Diff
  • def should_return_1():
        ad = lambda a,b: a and b
        demux = lambda i,s: (i and not s,i and s)
        nand = lambda a,b: not(a and b)
        nor = lambda a,b: not(a or b)
        return 10000000000000000000000000000 / 10000000000000000000000000000
    #33333333333333
    • def should_return_1():
    • ad = lambda a,b: a and b
    • demux = lambda i,s: (i and not s,i and s)
    • nand = lambda a,b: not(a and b)
    • nor = lambda a,b: not(a or b)
    • return 10000000000000000000000000000 / 10000000000000000000000000000
    • #33333333333333
Code
Diff
  • def why():
        return ''.join([chr(int(i, 16)) for i in ['0x77', '0x20', '0x2d', '0x20', '0x68', '0x20', '0x2d', '0x20', '0x79']])
    
    • def why():
    • return f"w - h - y"
    • #eeeepppppppppppppppppppppp
    • return ''.join([chr(int(i, 16)) for i in ['0x77', '0x20', '0x2d', '0x20', '0x68', '0x20', '0x2d', '0x20', '0x79']])