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 »
Sandbox

Post History

50%
+0 −0
Sandbox Sort letters by height [FINALIZED]

posted 2y ago by trichoplax‭  ·  edited 2y ago by trichoplax‭

#8: Post edited by user avatar trichoplax‭ · 2022-10-30T16:53:16Z (about 2 years ago)
Mark as finalized
  • Sort letters by height
  • Sort letters by height [FINALIZED]
  • Given a sequence of lower case letters, sort them into order of height.
  • ## Heights
  • The heights of letters are dependent on font, so for this challenge the height order to be used is as defined below:
  • ```text
  • acemnorsuvwxz
  • t
  • i
  • bdfghklpqy
  • j
  • ```
  • Letters on the same line are defined to be the same height. The first line is the shortest letters, the last line is the tallest letter.
  • ## Input
  • - A sequence of lower case letters
  • - This may be a string or any data structure of characters
  • ## Output
  • - A sequence of the same letters in sorted order
  • - This may be a string or any ordered data structure of characters. It does not need to match the input format (provided it is consistent between inputs)
  • - For example, you may take input as an array of characters, and output as a string, provided this format does not change for different inputs
  • - The sort does not need to be stable (letters that are the same height do not need to remain in the same order as the input, even if the input was already sorted)
  • - The sort may be either ascending or descending
  • ## Test cases
  • Since the sort order can be either ascending or descending, and the sort does not need to be stable, most inputs will have many possible valid outputs. The test cases are in the format `"input" : ["valid", "outputs"]`. You may choose any of the valid outputs, but you must output only one of them.
  • ```text
  • "a" : ["a"]
  • "aa" : ["aa"]
  • "atibj" : ["atibj", "jbita"]
  • "tick" : ["ctik", "kitc"]
  • "now" : ["now", "nwo", "onw", "own", "wno", "won"]
  • "just" : ["jtus", "jtsu", "sutj", "ustj"]
  • "pjztyix" : ["xztipyj", "zxtipyj", "xztiypj", "zxtiypj", "jypitzx", "jypitxz", "jpyitzx", "jpyitxz"]
  • ```
  • # Now posted: [Sort letters by height](https://codegolf.codidact.com/posts/287324)
  • ---
  • Given a sequence of lower case letters, sort them into order of height.
  • ## Heights
  • The heights of letters are dependent on font, so for this challenge the height order to be used is as defined below:
  • ```text
  • acemnorsuvwxz
  • t
  • i
  • bdfghklpqy
  • j
  • ```
  • Letters on the same line are defined to be the same height. The first line is the shortest letters, the last line is the tallest letter.
  • ## Input
  • - A sequence of lower case letters
  • - This may be a string or any data structure of characters
  • ## Output
  • - A sequence of the same letters in sorted order
  • - This may be a string or any ordered data structure of characters. It does not need to match the input format (provided it is consistent between inputs)
  • - For example, you may take input as an array of characters, and output as a string, provided this format does not change for different inputs
  • - The sort does not need to be stable (letters that are the same height do not need to remain in the same order as the input, even if the input was already sorted)
  • - The sort may be either ascending or descending
  • ## Test cases
  • Since the sort order can be either ascending or descending, and the sort does not need to be stable, most inputs will have many possible valid outputs. The test cases are in the format `"input" : ["valid", "outputs"]`. You may choose any of the valid outputs, but you must output only one of them.
  • ```text
  • "a" : ["a"]
  • "aa" : ["aa"]
  • "atibj" : ["atibj", "jbita"]
  • "tick" : ["ctik", "kitc"]
  • "now" : ["now", "nwo", "onw", "own", "wno", "won"]
  • "just" : ["jtus", "jtsu", "sutj", "ustj"]
  • "pjztyix" : ["xztipyj", "zxtipyj", "xztiypj", "zxtiypj", "jypitzx", "jypitxz", "jpyitzx", "jpyitxz"]
  • ```
#7: Post edited by user avatar trichoplax‭ · 2022-10-30T16:47:14Z (about 2 years ago)
Add test case
  • Given a sequence of lower case letters, sort them into order of height.
  • ## Heights
  • The heights of letters are dependent on font, so for this challenge the height order to be used is as defined below:
  • ```text
  • acemnorsuvwxz
  • t
  • i
  • bdfghklpqy
  • j
  • ```
  • Letters on the same line are defined to be the same height. The first line is the shortest letters, the last line is the tallest letter.
  • ## Input
  • - A sequence of lower case letters
  • - This may be a string or any data structure of characters
  • ## Output
  • - A sequence of the same letters in sorted order
  • - This may be a string or any ordered data structure of characters. It does not need to match the input format (provided it is consistent between inputs)
  • - For example, you may take input as an array of characters, and output as a string, provided this format does not change for different inputs
  • - The sort does not need to be stable (letters that are the same height do not need to remain in the same order as the input, even if the input was already sorted)
  • - The sort may be either ascending or descending
  • ## Test cases
  • Since the sort order can be either ascending or descending, and the sort does not need to be stable, most inputs will have many possible valid outputs. The test cases are in the format `"input" : ["valid", "outputs"]`. You may choose any of the valid outputs, but you must output only one of them.
  • ```text
  • "a" : ["a"]
  • "aa" : ["aa"]
  • "atibj" : ["atibj", "jbita"]
  • "tick" : ["ctik", "kitc"]
  • "now" : ["now", "nwo", "onw", "own", "wno", "won"]
  • "just" : ["jtus", "jtsu", "sutj", "ustj"]
  • ```
  • Given a sequence of lower case letters, sort them into order of height.
  • ## Heights
  • The heights of letters are dependent on font, so for this challenge the height order to be used is as defined below:
  • ```text
  • acemnorsuvwxz
  • t
  • i
  • bdfghklpqy
  • j
  • ```
  • Letters on the same line are defined to be the same height. The first line is the shortest letters, the last line is the tallest letter.
  • ## Input
  • - A sequence of lower case letters
  • - This may be a string or any data structure of characters
  • ## Output
  • - A sequence of the same letters in sorted order
  • - This may be a string or any ordered data structure of characters. It does not need to match the input format (provided it is consistent between inputs)
  • - For example, you may take input as an array of characters, and output as a string, provided this format does not change for different inputs
  • - The sort does not need to be stable (letters that are the same height do not need to remain in the same order as the input, even if the input was already sorted)
  • - The sort may be either ascending or descending
  • ## Test cases
  • Since the sort order can be either ascending or descending, and the sort does not need to be stable, most inputs will have many possible valid outputs. The test cases are in the format `"input" : ["valid", "outputs"]`. You may choose any of the valid outputs, but you must output only one of them.
  • ```text
  • "a" : ["a"]
  • "aa" : ["aa"]
  • "atibj" : ["atibj", "jbita"]
  • "tick" : ["ctik", "kitc"]
  • "now" : ["now", "nwo", "onw", "own", "wno", "won"]
  • "just" : ["jtus", "jtsu", "sutj", "ustj"]
  • "pjztyix" : ["xztipyj", "zxtipyj", "xztiypj", "zxtiypj", "jypitzx", "jypitxz", "jpyitzx", "jpyitxz"]
  • ```
#6: Post edited by user avatar trichoplax‭ · 2022-10-30T15:45:50Z (about 2 years ago)
Add test cases
  • Given a sequence of lower case letters, sort them into order of height.
  • ## Heights
  • The heights of letters are dependent on font, so for this challenge the height order to be used is as defined below:
  • ```text
  • acemnorsuvwxz
  • t
  • i
  • bdfghklpqy
  • j
  • ```
  • Letters on the same line are defined to be the same height. The first line is the shortest letters, the last line is the tallest letter.
  • ## Input
  • - A sequence of lower case letters
  • - This may be a string or any data structure of characters
  • ## Output
  • - A sequence of the same letters in sorted order
  • - This may be a string or any ordered data structure of characters. It does not need to match the input format (provided it is consistent between inputs)
  • - For example, you may take input as an array of characters, and output as a string, provided this format does not change for different inputs
  • - The sort does not need to be stable (letters that are the same height do not need to remain in the same order as the input, even if the input was already sorted)
  • - The sort may be either ascending or descending
  • ## Test cases
  • Since the sort order can be either ascending or descending, and the sort does not need to be stable, most inputs will have many possible valid outputs. The test cases are in the format `"input" : ["valid", "outputs"]`. You may choose any of the valid outputs, but you must output only one of them.
  • ```text
  • TODO: test cases
  • ```
  • Given a sequence of lower case letters, sort them into order of height.
  • ## Heights
  • The heights of letters are dependent on font, so for this challenge the height order to be used is as defined below:
  • ```text
  • acemnorsuvwxz
  • t
  • i
  • bdfghklpqy
  • j
  • ```
  • Letters on the same line are defined to be the same height. The first line is the shortest letters, the last line is the tallest letter.
  • ## Input
  • - A sequence of lower case letters
  • - This may be a string or any data structure of characters
  • ## Output
  • - A sequence of the same letters in sorted order
  • - This may be a string or any ordered data structure of characters. It does not need to match the input format (provided it is consistent between inputs)
  • - For example, you may take input as an array of characters, and output as a string, provided this format does not change for different inputs
  • - The sort does not need to be stable (letters that are the same height do not need to remain in the same order as the input, even if the input was already sorted)
  • - The sort may be either ascending or descending
  • ## Test cases
  • Since the sort order can be either ascending or descending, and the sort does not need to be stable, most inputs will have many possible valid outputs. The test cases are in the format `"input" : ["valid", "outputs"]`. You may choose any of the valid outputs, but you must output only one of them.
  • ```text
  • "a" : ["a"]
  • "aa" : ["aa"]
  • "atibj" : ["atibj", "jbita"]
  • "tick" : ["ctik", "kitc"]
  • "now" : ["now", "nwo", "onw", "own", "wno", "won"]
  • "just" : ["jtus", "jtsu", "sutj", "ustj"]
  • ```
#5: Post edited by user avatar trichoplax‭ · 2022-10-30T15:35:04Z (about 2 years ago)
List same height letters in alphabetical order
  • Given a sequence of lower case letters, sort them into order of height.
  • ## Heights
  • The heights of letters are dependent on font, so for this challenge the height order to be used is as defined below:
  • ```text
  • aceozxnmruwsv
  • t
  • i
  • yqpdfghklb
  • j
  • ```
  • Letters on the same line are defined to be the same height. The first line is the shortest letters, the last line is the tallest letter.
  • ## Input
  • - A sequence of lower case letters
  • - This may be a string or any data structure of characters
  • ## Output
  • - A sequence of the same letters in sorted order
  • - This may be a string or any ordered data structure of characters. It does not need to match the input format (provided it is consistent between inputs)
  • - For example, you may take input as an array of characters, and output as a string, provided this format does not change for different inputs
  • - The sort does not need to be stable (letters that are the same height do not need to remain in the same order as the input, even if the input was already sorted)
  • - The sort may be either ascending or descending
  • ## Test cases
  • Since the sort order can be either ascending or descending, and the sort does not need to be stable, most inputs will have many possible valid outputs. The test cases are in the format `"input" : ["valid", "outputs"]`. You may choose any of the valid outputs, but you must output only one of them.
  • ```text
  • TODO: test cases
  • ```
  • Given a sequence of lower case letters, sort them into order of height.
  • ## Heights
  • The heights of letters are dependent on font, so for this challenge the height order to be used is as defined below:
  • ```text
  • acemnorsuvwxz
  • t
  • i
  • bdfghklpqy
  • j
  • ```
  • Letters on the same line are defined to be the same height. The first line is the shortest letters, the last line is the tallest letter.
  • ## Input
  • - A sequence of lower case letters
  • - This may be a string or any data structure of characters
  • ## Output
  • - A sequence of the same letters in sorted order
  • - This may be a string or any ordered data structure of characters. It does not need to match the input format (provided it is consistent between inputs)
  • - For example, you may take input as an array of characters, and output as a string, provided this format does not change for different inputs
  • - The sort does not need to be stable (letters that are the same height do not need to remain in the same order as the input, even if the input was already sorted)
  • - The sort may be either ascending or descending
  • ## Test cases
  • Since the sort order can be either ascending or descending, and the sort does not need to be stable, most inputs will have many possible valid outputs. The test cases are in the format `"input" : ["valid", "outputs"]`. You may choose any of the valid outputs, but you must output only one of them.
  • ```text
  • TODO: test cases
  • ```
#4: Post edited by user avatar trichoplax‭ · 2022-10-30T14:20:16Z (about 2 years ago)
Allow different formats for input and output
  • Given a sequence of lower case letters, sort them into order of height.
  • ## Heights
  • The heights of letters are dependent on font, so for this challenge the height order to be used is as defined below:
  • ```text
  • aceozxnmruwsv
  • t
  • i
  • yqpdfghklb
  • j
  • ```
  • Letters on the same line are defined to be the same height. The first line is the shortest letters, the last line is the tallest letter.
  • ## Input
  • - A sequence of lower case letters
  • - This may be a string or any data structure of characters
  • ## Output
  • - A sequence of the same letters in sorted order
  • - This may be a string or any ordered data structure of characters.
  • - The sort does not need to be stable (letters that are the same height do not need to remain in the same order as the input, even if the input was already sorted)
  • - The sort may be either ascending or descending
  • ## Test cases
  • Since the sort order can be either ascending or descending, and the sort does not need to be stable, most inputs will have many possible valid outputs. The test cases are in the format `"input" : ["valid", "outputs"]`. You may choose any of the valid outputs, but you must output only one of them.
  • ```text
  • TODO: test cases
  • ```
  • Given a sequence of lower case letters, sort them into order of height.
  • ## Heights
  • The heights of letters are dependent on font, so for this challenge the height order to be used is as defined below:
  • ```text
  • aceozxnmruwsv
  • t
  • i
  • yqpdfghklb
  • j
  • ```
  • Letters on the same line are defined to be the same height. The first line is the shortest letters, the last line is the tallest letter.
  • ## Input
  • - A sequence of lower case letters
  • - This may be a string or any data structure of characters
  • ## Output
  • - A sequence of the same letters in sorted order
  • - This may be a string or any ordered data structure of characters. It does not need to match the input format (provided it is consistent between inputs)
  • - For example, you may take input as an array of characters, and output as a string, provided this format does not change for different inputs
  • - The sort does not need to be stable (letters that are the same height do not need to remain in the same order as the input, even if the input was already sorted)
  • - The sort may be either ascending or descending
  • ## Test cases
  • Since the sort order can be either ascending or descending, and the sort does not need to be stable, most inputs will have many possible valid outputs. The test cases are in the format `"input" : ["valid", "outputs"]`. You may choose any of the valid outputs, but you must output only one of them.
  • ```text
  • TODO: test cases
  • ```
#3: Post edited by user avatar trichoplax‭ · 2022-10-30T14:13:47Z (about 2 years ago)
Fix test case format
  • Given a sequence of lower case letters, sort them into order of height.
  • ## Heights
  • The heights of letters are dependent on font, so for this challenge the height order to be used is as defined below:
  • ```text
  • aceozxnmruwsv
  • t
  • i
  • yqpdfghklb
  • j
  • ```
  • Letters on the same line are defined to be the same height. The first line is the shortest letters, the last line is the tallest letter.
  • ## Input
  • - A sequence of lower case letters
  • - This may be a string or any data structure of characters
  • ## Output
  • - A sequence of the same letters in sorted order
  • - This may be a string or any ordered data structure of characters.
  • - The sort does not need to be stable (letters that are the same height do not need to remain in the same order as the input, even if the input was already sorted)
  • - The sort may be either ascending or descending
  • ## Test cases
  • Since the sort order can be either ascending or descending, and the sort does not need to be stable, most inputs will have many possible valid outputs. The test cases are in the format `input : ["valid", "outputs"]`. You may choose any of the valid outputs, but you must output only one of them.
  • ```text
  • TODO: test cases
  • ```
  • Given a sequence of lower case letters, sort them into order of height.
  • ## Heights
  • The heights of letters are dependent on font, so for this challenge the height order to be used is as defined below:
  • ```text
  • aceozxnmruwsv
  • t
  • i
  • yqpdfghklb
  • j
  • ```
  • Letters on the same line are defined to be the same height. The first line is the shortest letters, the last line is the tallest letter.
  • ## Input
  • - A sequence of lower case letters
  • - This may be a string or any data structure of characters
  • ## Output
  • - A sequence of the same letters in sorted order
  • - This may be a string or any ordered data structure of characters.
  • - The sort does not need to be stable (letters that are the same height do not need to remain in the same order as the input, even if the input was already sorted)
  • - The sort may be either ascending or descending
  • ## Test cases
  • Since the sort order can be either ascending or descending, and the sort does not need to be stable, most inputs will have many possible valid outputs. The test cases are in the format `"input" : ["valid", "outputs"]`. You may choose any of the valid outputs, but you must output only one of them.
  • ```text
  • TODO: test cases
  • ```
#2: Post edited by user avatar trichoplax‭ · 2022-10-30T14:06:51Z (about 2 years ago)
Modify sort order and clarify output
  • Given a sequence of lower case letters, sort them into order of height.
  • ## Heights
  • The heights of letters are dependent on font, so for this challenge the height order to be used is as defined below:
  • ```text
  • aceozxnmruwsv
  • it
  • yqpdfghklb
  • j
  • ```
  • Letters on the same line are defined to be the same height. The first line is the shortest letters, the last line is the tallest letter.
  • ## Input
  • - A sequence of lower case letters
  • - This may be a string or any data structure of characters
  • ## Output
  • - A sequence of the same letters in sorted order
  • - This may be a string or any ordered data structure of characters.
  • - The sort does not need to be stable (letters that are the same height do not need to remain in the same order as the input)
  • - The sort may be either ascending or descending
  • ## Test cases
  • Since the sort order can be either ascending or descending, and the sort does not need to be stable, most inputs will have many possible valid outputs. The test cases are in the format `input : ["valid", "outputs"]`. You may choose any of the valid outputs, but you must output only one of them.
  • ```text
  • TODO: test cases
  • ```
  • Given a sequence of lower case letters, sort them into order of height.
  • ## Heights
  • The heights of letters are dependent on font, so for this challenge the height order to be used is as defined below:
  • ```text
  • aceozxnmruwsv
  • t
  • i
  • yqpdfghklb
  • j
  • ```
  • Letters on the same line are defined to be the same height. The first line is the shortest letters, the last line is the tallest letter.
  • ## Input
  • - A sequence of lower case letters
  • - This may be a string or any data structure of characters
  • ## Output
  • - A sequence of the same letters in sorted order
  • - This may be a string or any ordered data structure of characters.
  • - The sort does not need to be stable (letters that are the same height do not need to remain in the same order as the input, even if the input was already sorted)
  • - The sort may be either ascending or descending
  • ## Test cases
  • Since the sort order can be either ascending or descending, and the sort does not need to be stable, most inputs will have many possible valid outputs. The test cases are in the format `input : ["valid", "outputs"]`. You may choose any of the valid outputs, but you must output only one of them.
  • ```text
  • TODO: test cases
  • ```
#1: Initial revision by user avatar trichoplax‭ · 2022-10-30T13:59:36Z (about 2 years ago)
Sort letters by height
Given a sequence of lower case letters, sort them into order of height.


## Heights
The heights of letters are dependent on font, so for this challenge the height order to be used is as defined below:

```text
aceozxnmruwsv
it
yqpdfghklb
j
```

Letters on the same line are defined to be the same height. The first line is the shortest letters, the last line is the tallest letter.

## Input
- A sequence of lower case letters
- This may be a string or any data structure of characters

## Output
- A sequence of the same letters in sorted order
- This may be a string or any ordered data structure of characters.
- The sort does not need to be stable (letters that are the same height do not need to remain in the same order as the input)
- The sort may be either ascending or descending

## Test cases
Since the sort order can be either ascending or descending, and the sort does not need to be stable, most inputs will have many possible valid outputs. The test cases are in the format `input : ["valid", "outputs"]`. You may choose any of the valid outputs, but you must output only one of them.

```text




TODO: test cases




```