I want to convert an Array[Int] to a Map[Int, Int] where each key is the element of the array and the respective value is the index of the element in the array.
Array(11, 12, 13) => Map((11,0), (12,1), (13,2))
Is it possible to do this without using a Mutable map, with a more functional style?
for example:
myArray.toMap(implicit def (... ))
Arrayhas any duplicate values:Array(2,3,2)