Ruby n, 1 = gets.split.map &:to_i -


this question has answer here:

i looking @ ruby code. unsure happening on line:

n,1 = gets.split.map &:to_i 

i understand input array of strings being mapped array of integers why being assigned n,1?

that line of code doesn't anything, it's syntaxerror. can't assign 1, that's not legal name local variable.


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

how does one get csharp-sqlite to throw exceptions for duplicates or foreign key constraint violations -

Simple Angular 2 project fails 'Unexpected reserved word' -