I would like to heat some feedback on this. I'm coming from a Java background and this is my first program in Scala. I solved Range Minimum Query problem.object Solution {  def main(args: Array[String]){    val readInfo = readLine.split( );    val numberofElements = Integer.parseInt(readInfo(0))    val numberOfQuery = Integer.parseInt(readInfo(1))    val storeElemets: Array[Int] =readLine.split( ).map(_.toInt);    val j =0;    for(j<-0 until numberOfQuery){      val z = readLine.split( )      val from = Integer.parseInt(z(0))      val to = Integer.parseInt(z(1))+1      val i=from      val getNumber = (from until to).map{i => storeElemets(i)}      println(getNumber.min);    }  }}I would like to know, What are the best practices and is there any better way to implement this solution ?
Range Minimum Query Implementation in Scala
optimization;performance;scala