Mercurial > lbo > hg > juliaplay
view circus.jl @ 0:d0c890aae379
Initial commit
author | Lewin Bormann <lbo@spheniscida.de> |
---|---|
date | Sat, 26 Nov 2022 09:23:14 +0100 |
parents | |
children |
line wrap: on
line source
function config1()::Vector{Tuple{Int,Int}} [(65,100), (70,180), (56,94), (75,190), (60,95), (68,110)] end function largest_tower(c::Vector{Tuple{Int,Int}})::Tuple{Int, Vector{Tuple{Int,Int}}} sort!(c; lt=((h1,w1), (h2,w2)) -> !(h1 < h2 || (h1 == h2 && w1 < w2))) n = 1 for i in 2:length(c) h2, w2 = c[i] h1, w1 = c[i-1] if h1 > h2 && w1 > w2 n += 1 else break end end n, c end