I am looking at some ruby code. But am unsure what is happening on this line:
n,1 = gets.split.map &:to_i
I understand some input array of strings is being mapped to an array of integers but why is that being assigned to n,1?
I am looking at some ruby code. But am unsure what is happening on this line:
n,1 = gets.split.map &:to_i
I understand some input array of strings is being mapped to an array of integers but why is that being assigned to n,1?
That line of code doesn't do anything, it's simply a SyntaxError
. You can't assign to 1
, that's not a legal name for a local variable.