I have created a below syntax to get a list of values.
def primeNum(n:Int) = (1 to 1000).filter(i =>i % 2 !=0 && (i > 2))
I am trying to get dynamically value from the result if I pass i/p n to any value(if n = 5 i need to get 5th value from result. If I pass n=7 i need to get 7th position value)
I am not able to get how to pass make it dynamically based based on input value.
Can some suggest.