Compare a list of strings: Difference between revisions

add BQN
m (Updated description and link for Fōrmulæ solution)
(add BQN)
Line 572:
test2 lstC fails</pre>
 
=={{header|BQN}}==
If grade up matches grade down, then all elements are equal.
 
If all are not equal and the list is invariant under sorting, then it is in ascending order.
<lang bqn>AllEq ← ⍋≡⍒
Asc ← ¬∘AllEq∧∧≡⊢
 
•Show AllEq ⟨"AA", "AA", "AA", "AA"⟩
•Show Asc ⟨"AA", "AA", "AA", "AA"⟩
 
•Show AllEq ⟨"AA", "ACB", "BB", "CC"⟩
•Show Asc ⟨"AA", "ACB", "BB", "CC"⟩</lang>
<lang bqn>1
0
0
1</lang>
 
[https://mlochbaum.github.io/BQN/try.html#code=QWxsRXEg4oaQIOKNi+KJoeKNkgpBc2Mg4oaQIMKs4oiYQWxsRXHiiKfiiKfiiaHiiqIKCuKAolNob3cgQWxsRXEg4p+oIkFBIiwgIkFBIiwgIkFBIiwgIkFBIuKfqQrigKJTaG93IEFzYyDin6giQUEiLCAiQUEiLCAiQUEiLCAiQUEi4p+pCgrigKJTaG93IEFsbEVxIOKfqCJBQSIsICJBQ0IiLCAiQkIiLCAiQ0Mi4p+pCuKAolNob3cgQXNjIOKfqCJBQSIsICJBQ0IiLCAiQkIiLCAiQ0Mi4p+pCg== Try It!
=={{header|C}}==
<lang c>#include <stdbool.h>
236

edits