I have a check(a, b, c) method that checks if a is in range between b and c (a >= b && a <= c).
For a given lists, for example, v = List(1,2) and r = List((3,4),(5,6)); I'd like to check if all values r is in ranges from r using the check method: check(1, 3, 4) && check (2, 5, 6).
I have high level solution as follows, but I have some missing parts.
val x = v zip r // (Int, (Int, Int))
val y = ??? // (Int, (Int, Int)) => (Int, Int, Int)
(y map check).forall {_ == true} // error
How can I get the solution?