title: Trying to find the lowest number in a kotlin array
body: <p>Kotlin newbie here, I'm trying to Write a program that finds the minimum value of N numbers.
  The first line contains the number N.
  The second line contains N numbers separated by spaces.
  Output an integer number which is the minimum of N numbers.
  So far I'm getting a null error, so I know the problem is in adding numbers to the array. Here is my code:</p>
  <pre><code>
  fun main(args: Array&lt;String&gt;) {
      val scanner = Scanner(System.`in`)
      val num1: Int = scanner.nextInt()
      var nums = arrayListOf&lt;Int&gt;()
      val smallestElement = nums.min()
      repeat (num1) {
          nums.add(scanner.nextInt())
      }
      println(smallestElement)
  
  }
  </code></pre>