I am newly learning Scala. below code has [A] multiple times. Please, someone, explain me in layman terms. I am unable to understand(tried google and read StackOverflow and others answers but I don't get it. The code below is to find kth element from the list.
def findKth[A](k:Int, l:List[A]):A = k match {
case 0 => l.head
case k if k > 0 => findKth(k - 1, l.tail)
case _ => throw new NoSuchElementException
}