Begin a new Kumite
Search
About
  • Filter by Language:
  • 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.

Code
Diff
  • function returnhundred() {
      const kissing_emoji = ':*';
      return kissing_emoji.split('').map(x=>x.charCodeAt()).reduce((a,b)=>a+b);
    }
  • 11 function returnhundred() {
    2-return 10 ** 2;
    2+ const kissing_emoji = ':*';
    3+ return kissing_emoji.split('').map(x=>x.charCodeAt()).reduce((a,b)=>a+b);
    33 }

Trimmed the lambda

Code
Diff
  • function getGemsOfColor(color, gems) {
      return gems.filter(gem => gem.colors.includes(color)).map(it => it.name).sort();
    }
  • 11 function getGemsOfColor(color, gems) {
    2- return gems.filter(gem => gem.colors.includes(color)).map(it => {return it.name}).sort();
    2+ return gems.filter(gem => gem.colors.includes(color)).map(it => it.name).sort();
    33 }
Code
Diff
  • fn foo() -> i32 {
        2
    }
  • 11 fn foo() -> i32 {
    2- 0
    2+ 2
    33 }

I suggest first converting the string to lower case so you don't need to add the conditional for checking for the uppercase 'A'.

Code
Diff
  • count=str=>str.toLowerCase().split("").filter(x=>x=="a").length;
  • 1-count=str=>str.split("").filter(x=>x=="a"||x=="A").length;
    1+count=str=>str.toLowerCase().split("").filter(x=>x=="a").length;