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
Want us to give you some help with your business? No problem, here's a video on who we can help, and how, along with our calendar so you can book in a call to discuss us working together.
Let's see