Compare length of two strings: Difference between revisions
Content added Content deleted
(add bqn) |
|||
Line 111: | Line 111: | ||
5 hello |
5 hello |
||
</pre> |
</pre> |
||
=={{header|BQN}}== |
|||
BQN's grade functions(similar to APL) produces the indices to sort an array. We grade the lengths, then use those to arrage the strings corrently. |
|||
<lang bqn>Compare ← >·(⍒⊑¨)⊸⊏≠⊸⋈¨ |
|||
•Show Compare ⟨"hello", "person"⟩ |
|||
•Show Compare ⟨"abcd", "123456789", "abcdef", "1234567"⟩</lang> |
|||
<lang>┌─ |
|||
╵ 6 "person" |
|||
5 "hello" |
|||
┘ |
|||
┌─ |
|||
╵ 9 "123456789" |
|||
7 "1234567" |
|||
6 "abcdef" |
|||
4 "abcd" |
|||
┘</lang> |
|||
=={{header|C}}== |
=={{header|C}}== |