view julia/circus.jl @ 3:c1db337c15be

Reorganize files
author Lewin Bormann <lbo@spheniscida.de>
date Tue, 14 Feb 2023 21:12:06 +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