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.

### Multiplying Strings

You will have an input and a factor.
Multiply the String by the factor.
For example: "hi",2 -> "hihi"

``````public class Kata{
public static String multiply(String input,int times){
String save = input;
for (int i = 1; i < times; i++) {
System.out.println(input);
input += save;
}
if(times == 0){
input = "";
}
return input;
}
}``````
Failed Tests

### kpdev's Kumite #2

FilteredText array needs to check all its objects and their properties. If the property is different then it becames "Mixed data".

The Output should look like this:

filteredText = [
{
innerHTML: 'Hello World',
fontSize: 'Mixed data',
fontWeight: '700',
},
{
innerHTML: 'Hello World',
fontSize: 'Mixed data',
fontWeight: '400',
},
{
innerHTML: 'Hello World',
fontSize: 'Mixed data',
fontWeight: '400',
},
]

``````let baseData = [
{
input_text1: "{'innerHTML': 'Hello World', 'fontSize': '5', 'fontWeight': '700'}",
input_text2: "{'innerHTML': 'Hello World', 'fontSize': '5', 'fontWeight': '400'}",
input_text3: "{'innerHTML': 'Hello World', 'fontSize': '5', 'fontWeight': '400'}",
input_shape1: "{x: 7, y, 150, width: 50, height: 50}",
input_shape2: "{x: 150, y, 80, width: 50, height: 50}",
input_shape3: "{x: 67, y, 150, width: 50, height: 50}",
},

{
input_text1: "{'innerHTML': 'Hello World', 'fontSize': '10', 'fontWeight': '700'}",
input_text2: "{'innerHTML': 'Hello World', 'fontSize': '5', 'fontWeight': '400'}",
input_text3: "{'innerHTML': 'Hello World', 'fontSize': '5', 'fontWeight': '400'}",
input_shape1: "{x: 50, y, 150, width: 50, height: 50}",
input_shape2: "{x: 150, y, 80, width: 50, height: 50}",
input_shape3: "{x: 30, y, 150, width: 50, height: 50}",
},

{
input_text1: "{'innerHTML': 'Hello World', 'fontSize': '5', 'fontWeight': '700'}",
input_text2: "{'innerHTML': 'Hello World', 'fontSize': '5', 'fontWeight': '400'}",
input_text3: "{'innerHTML': 'Hello World', 'fontSize': '5', 'fontWeight': '400'}",
input_shape1: "{x: 7, y, 150, width: 50, height: 50}",
input_shape2: "{x: 150, y, 50, width: 50, height: 50}",
input_shape3: "{x: 67, y, 150, width: 50, height: 50}",
},
]

let filteredText = baseData.map(el => {
return Object.entries(el).filter(key => key[0].includes('text'))
});``````

### GCD for any set of numbers

Arithmetic
Mathematics
Algorithms
Logic
Numbers
``````def greatest_common_divisor(*args):

def gcd(a, b):
if a == b: return a
elif a > b:
return (gcd(b, a % b) if a % b != 0 else b)
else:
return gcd(b, a)

res = gcd(args[0], args[1])
if len(args) > 2:
for i in range(2, len(args)):
res = gcd(res, args[i])
return res``````

### Fibonacci Sequence Class

A Class that helps with computing Fibonacci numbers, by treating them as linkedlist entries.

Calling FibonacciSequence next() outputs a biginteger for the current fibonacci value of the sequence's instance.

The sequence starts at 1.

``````import java.math.BigInteger;

public class FibonacciSequence {
private BigInteger first;
private BigInteger second;

public FibonacciSequence() {
second = BigInteger.ONE;
first = BigInteger.ZERO;
}

public BigInteger next() {
BigInteger returnVal = second;
updateValues();
return returnVal;
}

private void updateValues() {
BigInteger t = second;
first = t;
}
}``````

### test

wenn der übergebenen string mit a anfängt, gebe true zurück

``````public class test{
public static Boolean anfanga(String s){
if(s.startsWith("a")){
return true;
} else {
return false;
}
}
}``````
Failed Tests

### find highest and lowest number in a string array

You type a string of a list of numbers, and this method returns the highest int and the lowest int in the string.

``````public class ns {

public static String highAndLow(String numbers) {
String[] integerStrings = numbers.split(" ");

int[] integers = new int[integerStrings.length];

for (int i = 0; i < integers.length; i++){
integers[i] = Integer.parseInt(integerStrings[i]);

}
int maxValue = integers[0];
for(int y=1;y < integers.length;y++){
if(integers[y] > maxValue){
maxValue = integers[y];
}
}
int minValue = integers[0];
for(int q=1;q<integers.length;q++){
if(integers[q] < minValue){
minValue = integers[q];
}
}

String s = Integer.toString(maxValue);
String m = Integer.toString(minValue);
String r = s + " " + m;

return r;
}
public static void main(String args[]) {

System.out.println(highAndLow("13 48 19 20 24 12"));

}

}``````
Failed Tests

### skata

gfxcngfxcgnfxcgfn

``test = () => 3``

### Find The Poisoned Apple

Help the wicked witch!!
Given a binary tree, return the id of the branch containing a poisoned apple.
Each node has the following structure:
Node: {
id: int
poisoned: true/false
left: Node
right: Node
}

If no poisoned apple on the tree return -1.

``````const findPoisoned = (node) => {
// Help evil prevail !
return node == null || node == undefined ? -1
: node.poisoned ? node.id
: Math.max(findPoisoned(node.left),findPoisoned(node.right));
}``````

### Table drawing

A novel function to generate console formatted tables.

``````head = ["***", "Numbler =>", 40, 'another', "last"]
body = [
[ 1 , "B", "C", 2, 3],
["D", "E", "F", 4, 5]
]

``````def switchout(sentence,switchout,word):