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 letter(str):
        result = []
        words = [x for x in str.lower().strip().split() if x]
        mx = len(max(words, key=len)) if words else 0
        starts = set(x[:i] for x in words for i in range(1, mx+1))
        for s in starts:
            matching = [word for word in words if word.startswith(s)]
            if len(matching) == len(s):
                result += matching
        return sorted(result)
    • import re
    • def letter(str):
    • words = re.sub(r"[^a-z]", " ", str.lower()).split(" ")
    • lst = []
    • l1 = []
    • l2 = []
    • sol = []
    • for x in words:
    • word = ""
    • for y in x:
    • word += y
    • lst.append(word)
    • for x in sorted(set(lst)):
    • for y in words:
    • if y.startswith(x):
    • l1.append(y)
    • l2.append(list(l1))
    • l1.clear()
    • dic = dict(zip(sorted(set(lst)), l2))
    • for k, v in dic.items():
    • if len(k) == len(v):
    • for x in v:
    • sol.append(x)
    • return sorted(sol)
    • result = []
    • words = [x for x in str.lower().strip().split() if x]
    • mx = len(max(words, key=len)) if words else 0
    • starts = set(x[:i] for x in words for i in range(1, mx+1))
    • for s in starts:
    • matching = [word for word in words if word.startswith(s)]
    • if len(matching) == len(s):
    • result += matching
    • return sorted(result)

fork dos

Code
Diff
  •  def pepito(testing):
        return testing
    • def pepito(chiqui):
    • return chiqui
    • def pepito(testing):
    • return testing
Fundamentals
Restricted
Code
Diff
  • is_even=lambda*x:not(x[False]&True)
    • is_even=lambda*x:x[False]%(True+True)==False
    • is_even=lambda*x:not(x[False]&True)
Fundamentals
Games
Code
Diff
  • def riddle(w) = w.index("?")
    • def riddle(w) = /\?/ =~ w
    • def riddle(w) = w.index("?")
Code
Diff
  • class Account {
      
      private int balance = 0;
      
      public void deposit(int amount) throws IllegalArgumentException {
        if(amount < 0) {
          throw new IllegalArgumentException("You cannot deposit negative money!");
        }
        balance += amount;
      }
      
      public void withdraw(int amount) throws IllegalArgumentException {
        if (amount < 0) {
          throw new IllegalArgumentException("You cannot withdraw negative money!");
        }
        if(amount > balance) {
          throw new IllegalArgumentException("You cannot withdraw more than you have!");
        }
        balance -= amount ;
      }
      
      public String getStatement() {
        return String.valueOf(balance);
      }
      
    }
    • class Account {
    • private int balance = 0;
    • void deposit(int amount){
    • public void deposit(int amount) throws IllegalArgumentException {
    • if(amount < 0) {
    • throw new IllegalArgumentException("You cannot deposit negative money!");
    • }
    • balance += amount;
    • }
    • void withdraw(int amount) throws IllegalArgumentException{
    • public void withdraw(int amount) throws IllegalArgumentException {
    • if (amount < 0) {
    • throw new IllegalArgumentException("You cannot withdraw negative money!");
    • }
    • if(amount > balance) {
    • throw new IllegalArgumentException("You cannot withdraw more than you have!");
    • }
    • balance -= amount ;
    • }
    • String getStatement() {
    • public String getStatement() {
    • return String.valueOf(balance);
    • }
    • }