Kata of the Day #1

What is between?

kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
Kata of the Day #1

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.

TypeScript


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}`;
  }
}

Go


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
ByCesar Kohl

Need some help?

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
budget
budget
budget
budget
budget
budget
budget
budget
budget
budget

Subscribe to our newsletter

subscribe
subscribe
subscribe
subscribe
subscribe
subscribe
subscribe
subscribe
subscribe
subscribe