Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,5 +1,5 @@
|
|||
def zigzag(n)
|
||||
(seq=(0...n).to_a).product(seq)
|
||||
(seq=(0...n).to_a).cartesian_product(seq)
|
||||
.sort_by {|x,y| [x+y, (x+y).even? ? y : -y]}
|
||||
.map_with_index{|v, i| {v, i}}.sort.map(&.last).each_slice(n).to_a
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue