What is between?
Complete the function that takes two integers (a, b, where a < b) and return an array of all integers between the input parameters, including them.
export class Kata {
static highAndLow(numbers: string): string {
let arr: number[] = numbers.split(" ").map(Number);
let max: number = Math.max(...arr);
let min: number = Math.min(...arr);
return `${max} ${min}`;
}
}
package kata
func Between(a, b int) []int {
var arr []int
for i := a; i <= b; i++ {
arr = append(arr, a)
a++
}
return arr
}
Go to Kata