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

added 5 characters in body
Source Link
nimi
  • 36k
  • 4
  • 35
  • 100

Haskell, 26(削除) 26 (削除ここまで) 24 bytes

f n=any(==n)$mapn=elem n$map(^2)[0..n]

Try it online! Try it online!

Checks if any ofn is in the numberslist of all squares from 0 up to n squared equals n.

Haskell, 26 bytes

f n=any(==n)$map(^2)[0..n]

Try it online!

Checks if any of the numbers from 0 up to n squared equals n.

Haskell, (削除) 26 (削除ここまで) 24 bytes

f n=elem n$map(^2)[0..n]

Try it online!

Checks if n is in the list of all squares from 0 to n.

Source Link
nimi
  • 36k
  • 4
  • 35
  • 100

Haskell, 26 bytes

f n=any(==n)$map(^2)[0..n]

Try it online!

Checks if any of the numbers from 0 up to n squared equals n.

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