Sparse Arrays

  • + 0 comments

    Scala

        def matchingStrings(strings: Array[String], queries: Array[String]): Array[Int] = {
                queries.map(q => strings.count(_ == q))
        }