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 Answer

deleted 9 characters in body
Source Link
briantist
  • 3.3k
  • 16
  • 21

PowerShell, (削除) 31 (削除ここまで) 30 bytes

"$args"-in(1..1e6|%{($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.

PowerShell, (削除) 31 (削除ここまで) 30 bytes

"$args"-in(1..1e6|%{($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.

PowerShell, (削除) 31 (削除ここまで) 30 bytes

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

Try it online!

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

added 8 characters in body
Source Link
briantist
  • 3.3k
  • 16
  • 21

PowerShell, 31(削除) 31 (削除ここまで) 30 bytes

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

Try it online! 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.

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.

PowerShell, (削除) 31 (削除ここまで) 30 bytes

"$args"-in(1..1e6|%{($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.

Source Link
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.

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