Spark-Scala, RDD, counting the elements of an array by applying conditions

Let’s continue on Spark-Scala RDD, group by count from array of array rather than using a new topic.