7 kyu
Computer problem series #1: Fill the Hard Disk Drive
2,334 of 7,539albertogcmr
Loading description...
Lists
Arrays
Fundamentals
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.
Python new test framework
Approved
File sizes should either be strictly greater than 0 or it has to be specified how a full harddisk behaves when files of size 0 are to be saved.
Solved. Added tests and description.
Zero size files can always be saved in a full HD
Java translation
.
.
where do i get the cool tag thingies on my username
This kata is a subject to deduplication process here: https://github.com/codewars/content-issues/issues/151.
Please join the discussion to help us identify duplicate kata and retire them.
COBOL translation.
.
Sorta challenging for a 7 kyu imo, but still a good kata
Okay, it seems like this one is a duplicate [A bit too late but if based on the creation data, this should be retired, however if based on solves and languages, the other one should be retired] T_T What do you and the community think is a bette alternative ??? (Raising in both katas)
This comment has been hidden.
Updated Dart translation (Dart 2.14).
Nice fun simple Kata!
If you sort the list of file you can put more file in the HD. but your test aren't sorting.
You should be more clearer that the file must be saved in the order they appear.
Done.
Sorry my bad. I Ignored the fact that you mentioned "Queue". This should be a suggestion, not an issue.
Elixir translation Julia translation
Accepted
I think strange things can happen to some of the accepted solutions if you get too close to the limits of the data type the file size...
e.g. (in
C
)Perhaps Kata description should say these kind of boundaries are not tested by the Kata...
Since all tanslations matched, I added parameter limits to the description ~ but remain intrigued by other possibilities.
I wasn't referring to bad inputs;
Even for valid input there is risk of overflowing some total_size datatype. E.g. it could happen if the user solution is adding up (valid, but huge) file sizes before comparing with HD size.
Missing edge case
save [] 1 -> 0
( and possiblysave [] 0 -> 0
).Thank you for your suggestion but it is said no invalid input in the description. I don't think those edge cases are needed.
Your kata.
Haskell translation
.
Other than the current translations waiting (JS and Crystal), please approve B4B's Ruby fork too: https://www.codewars.com/kumite/5d4c6c16dffa7bcd2efcbe28?sel=5d4d419ffeb62f00113274a8
Done for Ruby
sample tests aren't consistent through all languages (only 2 in python)
fixed
C translation kumited
I feel like it should be made a little clearer that the files must be saved in the order they appear in the list.
Not an issue, it is a suggestion.
Sorry, tried to submit it under 'optional improvement'. My bad.
Thank you for your suggestion but in my opinion it gets clear with the examples. And the description mentions a queue.
.
it... "does"... But why do you want to obfuscate the fact? This is a simple kata, make the rules clear.
Examples are not a replacement for full specs. Examples still require reverse engineering, aka "reading your mind".
This applies to all kata, not just simple or unsimple ones.
The user can modify the input.
How can they do it?
Well, to clone an array (fix it) in Python you use
arrray[:]
.Fixed.
This kata seems to beg for a performance standard. What if the HD capacity was massive, and the array had enough items to make an iterative solution timeout?
And I have to make all my translation's reference solutions longer? Argh... :D
That'd be impossible to achieve in languages where iteration is the only way to sum all values.
JavaScript translation CoffeeScript translation :coffee: Crystal translation :gem: Dart translation :dart:
Thank you Steffan153. Some changes has been made in the kata before i can accept your translation, i think
Ah, some merge conflicts; here are the forks: https://www.codewars.com/kumite/5d4c25518bbcfdb7941deae4?sel=5d4c6543cfc30d4fc3605c45 https://www.codewars.com/kumite/5d4c27fbdffa7b9627e73b16?sel=5d4c654d8368630017b7f032 https://www.codewars.com/kumite/5d4c2a9b1a9682b476304322?sel=5d4c65603167f18e19a69813 Also added Ruby translation
???? :smile: And TypeScript translation And PHP translation
Thank you Steffan153. Let me know if i need to validate another of your translations. I think i lost count. XD
No prob.
Crystal JS
There was a glitch in Ruby (it didn't show in the language menu), so try this one: https://www.codewars.com/kumite/5d4c6c16dffa7bcd2efcbe28?sel=5d4ca07ca3d80c00217f2f43
Also just added a C++ translation.
EDIT: Oopps, Crystal and JS are still wating O_o
I'm trying but i'm getting this message for JS and Crystal:
Any guidance please?
Well, that means the description got changed and now my translations are outdated (a descrpition merge conflict). Here are the forks: https://www.codewars.com/kumite/5d4c6543cfc30d4fc3605c45?sel=5d4eaf7703a87b0011c0e0ac https://www.codewars.com/kumite/5d4c65603167f18e19a69813?sel=5d4eafa7e1368a000fecf060
The last translation (Crystal) is still waiting... You can find all waiting translaitons under the language menu, and "+ Add New".
Missing edge cases where all files fit on HDD exactly, and where the HDD has more space than needed.
Added these tests.
Thank you, i appreciate it.
The solution is in the preloaded code (which always makes someone raise an issue ;)), so I can use your reference solution: https://www.codewars.com/kata/reviews/5d4c054a9e72d1000129f39c/groups/5d4c0f3c57245b000152478e Simply turn the
test.it("Random tests")
into a decorator:@test.it("Random tests")
. Then, right below it, put a function (the decorator will call it) with any name, and do all the random tests there. But, also declare your reference solution in there.This comment has been hidden.
Refer to this, and edit your comment to hide the solution.
Yes it is.