Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- val v1
- For each element of SpecificArray
- Get the corresponding element from GlobalArray to use its Array[String]
- If (sum <= 100)
- for each String of the Array
- update v1
- // ... some calculation
- sum += 1
- println (v1)
- SpecificArray.map{x => val in_global = GlobalArray.filter(e => (e._1 == x._1))
- // I don't know how to follow
- }
- val globalMap = GlobalArray.toMap
- println(SpecificArray.flatMap({case (k,v) => globalMap(k).map(s => (k,v,s))}).toList)
- println(SpecificArray.flatMap({case (k,v) => globalMap(k)}).toList)
- println(SpecificArray.flatMap({case (k,v) => globalMap.getOrElse(k, Array()).map(s => (k,v,s))}).toList)
Add Comment
Please, Sign In to add comment