I am having a problem understanding how array.sort{ |x,y| block } works exactly, hence how to use it?
array.sort{ |x,y| block }
An example from Ruby documentation:
Some miscellaneous points:
x
y
<=>