Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Revisions

1 of 3
briantist
  • 3.3k
  • 16
  • 21

PowerShell, 31 bytes

"$args"-in(1..10e5|%{($s+=$_)})

Try it online!

Nice and slow brute force method. Make an array of every of every sum of 1 through 106, and see if the argument is in there.

briantist
  • 3.3k
  • 16
  • 21

AltStyle によって変換されたページ (->オリジナル) /