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
  • import codecs
    exec(codecs.encode('cevag(pbqrpf.rapbqr("".wbva([v sbe v va pbqrpf.rapbqr("uryyb jbeyq",rapbqvat="ebg13",reebef="vtaber")]),rapbqvat="ebg13",reebef="vtaber"))',encoding="rot13",errors="ignore"))
    • print("".join([i for i in "hello world"]))
    • import codecs
    • exec(codecs.encode('cevag(pbqrpf.rapbqr("".wbva([v sbe v va pbqrpf.rapbqr("uryyb jbeyq",rapbqvat="ebg13",reebef="vtaber")]),rapbqvat="ebg13",reebef="vtaber"))',encoding="rot13",errors="ignore"))
Code
Diff
  • import re
    def is_palindrome(s: str) -> bool:
        return re.sub('[^a-z]', '', s.lower())[::-1] == re.sub('[^a-z]', '', s.lower())
    • import re
    • def is_palindrome(s: str) -> bool:
    • temp = ''.join(x for x in s if x.isalpha()).lower()
    • return temp[::-1] == temp
    • return re.sub('[^a-z]', '', s.lower())[::-1] == re.sub('[^a-z]', '', s.lower())
Code
Diff
  • five_ninths = 5 / 9
    nine_fifths = 9 / 5
    
    celsius = lambda temp: round((temp - 32) * five_ninths, 2)
    fahrenheit = lambda temp: round(temp * nine_fifths + 32, 2)
    
    def temperature_converter(temp: float, conversion='both') -> float:
        return celsius(temp) if conversion == 'celsius' else \
               fahrenheit(temp) if conversion == 'fahrenheit' else \
               f"{celsius(temp)}c, {fahrenheit(temp)}f"
    • five_ninths = 5 / 9
    • nine_fifths = 9 / 5
    • celsius = lambda temp: round((temp - 32) * five_ninths, 2)
    • fahrenheit = lambda temp: round(temp * nine_fifths + 32, 2)
    • def temperature_converter(temp: float, conversion='both') -> float:
    • celsius = round((temp - 32) * five_ninths, 2)
    • fahrenheit = round(temp * nine_fifths + 32, 2)
    • conversions = {
    • 'celsius' : celsius,
    • 'fahrenheit' : fahrenheit,
    • 'both' : f"{celsius}c, {fahrenheit}f"
    • }
    • return conversions[conversion]
    • return celsius(temp) if conversion == 'celsius' else \
    • fahrenheit(temp) if conversion == 'fahrenheit' else \
    • f"{celsius(temp)}c, {fahrenheit(temp)}f"
Code
Diff
  • def solution():
        import __main__
        __main__.refsol()
    
    • def solution():
    • import tests
    • tests.refsol()
    • import __main__
    • __main__.refsol()
Code
Diff
  • var solution = (s) => {
        let total = 0;
        for(let index = 0; index < s.length; index++){
            if((s.length >= index + 1) && (romanMap[s[index]] < romanMap[s[index + 1]])){ 
                total += romanMap[s[index + 1]] - romanMap[s[index]];
                index ++;
            } else { 
                total += romanMap[s[index]];
            }
        }
        return total;
    };
    
    const romanMap = {
        'I': 1,
        'V': 5,
        'X': 10,
        'L': 50,
        'C': 100,
        'D': 500,
        'M': 1000
    };
    
    • package kata
    • var solution = (s) => {
    • let total = 0;
    • for(let index = 0; index < s.length; index++){
    • if((s.length >= index + 1) && (romanMap[s[index]] < romanMap[s[index + 1]])){
    • total += romanMap[s[index + 1]] - romanMap[s[index]];
    • index ++;
    • } else {
    • total += romanMap[s[index]];
    • }
    • }
    • return total;
    • };
    • func Decode(roman string) int {
    • return 0
    • }
    • const romanMap = {
    • 'I': 1,
    • 'V': 5,
    • 'X': 10,
    • 'L': 50,
    • 'C': 100,
    • 'D': 500,
    • 'M': 1000
    • };