From d27319e533ab17da0918ef1400b2a661a644d55e Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Thu, 24 Jun 2021 15:34:19 +0200 Subject: problem 74 in julia --- julia/112-bouncy_numbers.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'julia/112-bouncy_numbers.jl') diff --git a/julia/112-bouncy_numbers.jl b/julia/112-bouncy_numbers.jl index 4877ed9..ab136ca 100644 --- a/julia/112-bouncy_numbers.jl +++ b/julia/112-bouncy_numbers.jl @@ -20,8 +20,8 @@ using Base.Iterators function is_bouncy(n) - s = collect(string(n)) - !(issorted(s) || issorted(s, rev=true)) + ds = digits(n) + !(issorted(ds) || issorted(ds, rev=true)) end const RATIO = 0.99 -- cgit