Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Challenges

Comments on Are All Elements Equal?

Post

Are All Elements Equal?

+10
−0

Challenge

Given a list of integers >= 0 , check if all of them are equal.

Tests

[1,1,1,1,1] -> true
[0,1,1,6,7] -> false
[1]         -> true  
[]          -> undefined(you do not need to handle this)

You may take the integers in any form(strings, list, codepoints, etc.)

You can output two distinct values for true or false, or simply a truthy or falsy value in your language.

Trivial builtins are allowed, but it is encouraged to edit them into the trivial builtins answer, or try a different approach.

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.
Why should this post be closed?

2 comment threads

Trivial builtins (2 comments)
CW trivial builtins answer? (5 comments)
CW trivial builtins answer?
user‭ wrote about 3 years ago

Since there's no trivial builtins answer yet, I edited my Husk one into one. Any idea on how to CW it? Or perhaps it could be edited into the question itself?

Razetime‭ wrote about 3 years ago

hm, I guess you can post trivial answers in a separate thread.

user‭ wrote about 3 years ago

How do you do that?

Razetime‭ wrote about 3 years ago

just create a comment thread on the question named Trivial Builtins and post your answer under there.

user‭ wrote about 3 years ago

Ah, got it. (pad)