DEV Community

Discussion on: Daily Challenge #71 - See you next Happy Year

Collapse
 
mbaas2 profile image
Michael Baas • Edited

APL (I'm using Dyalog APL)

Code:

{4=+/⎕d∊⍕⍵:⍵⋄∇⍵+1}

Tests:

     {4=+/⎕d∊⍕⍵:⍵⋄∇⍵+1}7712
7801
     {4=+/⎕d∊⍕⍵:⍵⋄∇⍵+1}1001
1023
     {4=+/⎕d∊⍕⍵:⍵⋄∇⍵+1}2019
2019