aboutsummaryrefslogtreecommitdiff
path: root/julia/112-bouncy_numbers.jl
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2021-06-24 15:34:19 +0200
committerCharles Cabergs <me@cacharle.xyz>2021-06-24 15:34:19 +0200
commitd27319e533ab17da0918ef1400b2a661a644d55e (patch)
treea95e060efc2139e0658333a4a362fe6ab401b9b2 /julia/112-bouncy_numbers.jl
parentd8d3fff46bd06d8638abf06e1716fc4a1dc6c2a6 (diff)
downloadproject_euler-d27319e533ab17da0918ef1400b2a661a644d55e.tar.gz
project_euler-d27319e533ab17da0918ef1400b2a661a644d55e.tar.bz2
project_euler-d27319e533ab17da0918ef1400b2a661a644d55e.zip
problem 74 in julia
Diffstat (limited to 'julia/112-bouncy_numbers.jl')
-rw-r--r--julia/112-bouncy_numbers.jl4
1 files changed, 2 insertions, 2 deletions
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