I have the below arrays with me
scala> arr1
res77: Array[Array[Int]] = Array(Array(5, 1, 99), Array(1, 2, 99), Array(2, 3, 99), Array(5, 6, 99))
scala> arr2
res78: Array[Array[Int]] = Array(Array(5, 1, 110), Array(1, 2, 110), Array(2, 3, 110), Array(5, 6, 110))
The third element of each item of this array will be a constant value(ie, 99 for first and 110 for second). I have to take the values from the array, based on this third element
ie, if the third element <=100 , I have to get those items in the array whose second element is < 5
if the third element >100 , I have to get those items in the array whose second element is > 5
Expected Output:
Array[Array[Int]] = Array(Array(5, 1, 99), Array(1, 2, 99), Array(2, 3, 99) ) //Output for arr1
Array[Array[Int]] = Array(Array(5, 6, 110)) //Output for arr2
How can i make a generalized code ?