8 kyu
Sort My Textbooks
4,987 of 8,183Heated
Loading description...
Lists
Sorting
Fundamentals
Arrays
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
The rules are not clearly described. If the beginning letters of two books are the same, the second letters of the two books should be compared, and so on. But it is not mentioned at all in the rules. Please remember that this is 8kyu. The rules are unclear and will cause trouble to novice programmers.
hey authour, this is just a trash, another crap kata
Would you be so kind (this time) to give some more details what exactly you did not like about this kata? You got any problems with it? Is there something what needs to be fixed? Or some other problem?
"The sorting should NOT be case sensitive" - but it is. This is not an 8 kyu kata and description is not good.
Seems that the order of symbols is different than expected because JS's default sort order (based on Unicode code points). Are there any solutions for this, or should we use a switch/case statement for every non-letter symbol?
The description does not specify how the items should be sorted. If it's supposed to be in alphabetical order, including symbols makes no sense. If it's by ascii value, requiring case-insensitivity makes no sense.
I think alphabetical order should be specified in the description and the symbol test case should be removed.
There's only one fixed test that fucks things up, and no random tests with symbols (JS). Horrible test design, and unclear specs. Decyphering what to do in a 8 kyu should be non existent.
the instructions are not very clear
It should be 9 kyu.
Not really an 8 kyu kata in my oppinion, 7kyu would be more appropriate. Also the instructions are not very clear, an example would have been great.
That being said, it is a great problem to solve and understand.
This doesn't seem like an 8 kyu to me. More like a 7 for sure.
This comment has been hidden.
Switched to using wrapped Java builtins for the string comparison, making it identical to the Java translation.
The random tests still generate characters between
'Z'
and'a'
, their ordering relative to letters is unclear.This comment has been hidden.
Scala translation
Approved
This comment has been hidden.
Approved
JavaScript Translation (author inactive).
Approved
Java tests replaced in this fork.
approved
python new test framework is required. updated in this fork
Approved
Go translation
D translation
Rust translation
I got an assert error with capitalization test. But after proceeding in attempt I pass all of the test. What is this.
It should not be 8 kyu
WTF?
Learned new key for sorting.Nice)
This Kata is terrible and if I ever figure out how the symbols are supposed to be sorted I will do my small part to lower the satisfaction rating. Edit: I think it is a reasonable hint for other with the same issue I had, the symbols with ASCII values between 91 and 96 are considered alphabetically BEFORE normal letters for the purposes of this kata.
This comment has been hidden.
Thanks, spent couple of minutes understanding why my code fails.....
The instructions for this kata are very unclear. They direct the user to sort the list, but it provides no criteria by which they should be sorted. Should it be alphabetical? Reverse alphabetical? By length of the title? The criteria for sorting them should be clearly provided.
This comment has been hidden.
Fixed. Thank you for raising this issue.
Nice requirements of using multiple commands to acheive the goal, while still being a relatively simple kata for 8 kyu
This comment has been hidden.
Confirmed. That's Java.
(Note: For an unknown reason, I don't see the "edit kata" button while the issue is open... :o )
(see recent java fork)
fixed for Java
The tests are not runnin at all:
"Failed to detect class name: // Insert smiley face;"
Fixed, please try again.
Java method signature
Level 8 kyu especially should not be using bad practices!
public static ArrayList<String> sort(ArrayList<String> textbooks)
... and IMO it's bad practice to pass implementation classes like
ArrayList
around as params or required returns when there are perfectly good interfaces likeList
.I'm new to programming, so I have yet to come across this convention, but it's in now. Thanks for the feedback.
It's not really a "convention" - it's what interfaces are for.
https://docs.oracle.com/javase/tutorial/java/IandI/createinterface.html
e.g. By using List your API allows the programmer more flexibility as they are not forced to implement the method using ArrayList
Fair enough
Java initial solution typo in import
import java.util.Arraylist;
fixed;-)...
What does the "does not handle capitaliazation" error means?
Hi! I think it means that the code does not distinguish between lowercase and uppercase. For example, if you wanted the code to ignore the case of a string, you could convert all the strings to lowercase by typing .lower()
I have the same issue. Still working on it!
it means if one array contains 'JASON' and 'jason', and the other contains 'JASon' and 'JASON', the final array should return only 'JASON'. I hope that helps
Is it a good idea to put answer in the
Sample Tests
? o_ORight... I just saw it and took it off. Fixing it right now. (Don't do Kata when you're sleep deprived)