7 kyu
Suitcase packing
741 of 1,9070xbba
Loading description...
Puzzles
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 is required. updated in this fork
The squares should be placed next to each other and NOT on top of each other. (my first idea ;-)
The description is ambiguous and misleading.
The term "size" in the description is ambiguous for squares since it could be either an area or the length of a side. Additionally, the description is generally confusing (my opinion as well as that of several others in the discussion).
An improvement would be something like:
a - length of side of square 1 b - length of side of square 2 m - length of x-dimension of suitcase n - length of y-dimension of suitcase
How it working?
This is kata test cases not right and strange!
How could we answer you? Can you ask a real question, and provide examples? This may help: https://docs.codewars.com/training/troubleshooting/
I agree with with the opinion that the question should be a little more explicit. Otherwise, nice, Kata !
The length and width of the rectangle are not fixed. Very bad task description
m and n are arguments of your function, why would them be fixed?
COBOL translation (author inactive).
Approved
a and b are edges of two squares, m and n are edges of a rectangle.
This comment has been hidden.
There is wrong description. You will never solve the exersise.
So how did 1100+ people solve it?
This comment has been hidden.
I can't know which cases works. Some case should work but is expected as false in tests and inversely.
According to examples 2 rectangles of size 1x2 fit in suitcase of size 3x2. So, according to tests, if 2 rectangles of size 1x2 can't fit in suitcase of size 2x2 and, 2 rectangles of size 7x2 can fit in suitcase of size 9x7, then why 2 rectangles of size 7x2 can't fit in suitcase of size 8x7 ?????????????? SO STRANGE !!!!!
The description is not clear enough, i can't understand the rules.
For example? Print the input, show us which cases you think are wrong and state the language you tried. Otherwise we can't do anything.
That's done.
And is that Rust?
Read the description again:
So, one square size is
a x a
and another isb x b
. They're not two rectangles ofa x b
Yes
Both tests are ok, you misunderstood the instructions somehow. Read them again, you'll see it's all there.
Я чет вообще не понял описание, как это можно решить?
a and b are the sides of two different squares... m and n are the suitcase sizes...
Смотри, у тебя есть чемодан и туда нужно положить два квадрата. Фишка в том (в условии этого не написано), что квадраты должны поместиться один рядом с другим.
Haskell translation
In c#, the brackets of the starter code should be formatted properly.
The description should explain a and b are the length of the sides of the two squares, m and n are the length and width of the suitcase.
Using descriptive variables would be a good self-documenting way of solving this. ex:
FitSquares(int squareASide, int squareBSide, int suitcaseWidth, int suitcaseLength)
Lastly, there is at least one solution in c# that clearly should not have passed. It is currently marked as the second best answer. :P
Test cases could include all permutations of 1234 to keep out cheating answers.
Question needs to be explained a little better for what the input is specifically because it sounds like you have two boxes and two suitcases but the tests don't support that theory.
Edges of a square are equal by definition.
Not a kata suggestion
Hi. How do I see a failing test? (actual results vs expected results). I only can see that 7 tests failed, but if I click them, nothing happens. So I don't know what the tests are about and why they fail. Thank you.
PHP Translation
Javascript error:
a=7 and b=2 should NOT fit into m=8 and n=7 Expected: false, instead got: true
| 1 | 1 | 1 | 1 | 1 | 1 | 1 | E | | 1 | 1 | 1 | 1 | 1 | 1 | 1 | E | | 2 | 2 | 2 | 2 | 2 | 2 | 2 | E | | 2 | 2 | 2 | 2 | 2 | 2 | 2 | E | | E | E | E | E | E | E | E | E | | E | E | E | E | E | E | E | E | | E | E | E | E | E | E | E | E |
How is this supposed to be false?
A and B are the side lengths of the squares you want to fit in:
Suitcase (8x7)
| E | E | E | E | E | E | E | E |
| E | E | E | E | E | E | E | E |
| E | E | E | E | E | E | E | E |
| E | E | E | E | E | E | E | E |
| E | E | E | E | E | E | E | E |
| E | E | E | E | E | E | E | E |
| E | E | E | E | E | E | E | E |
A (7x7)
| A | A | A | A | A | A | A |
| A | A | A | A | A | A | A |
| A | A | A | A | A | A | A |
| A | A | A | A | A | A | A |
| A | A | A | A | A | A | A |
| A | A | A | A | A | A | A |
| A | A | A | A | A | A | A |
B (2x2)
| B | B |
| B | B |
Wow, totally thought about this wrong thanks!
square: 11,9 squareMax: 11 maleta: 52x52 ladoMin: 52 True
This is my result and kata tell me False, why?
F# Translation
Approved
Rust Translation
alr approved some time ago
Mr Square isn't packing squares but rectangles. Please change description of Kata or test cases to reflect this.
The way I understood it was A was the side length of 1 square and B was the side length of the other square.
Yes, now that you said it I see it too. I think the description might still need some clarification though.
I had to go to the comments to see what the question was, because the examples didn't make sense to me at all.
The description is lacking.
C translation kumited
please scrutinize for approval
I'm having difficulty understanding the parameters. Since he is trying to fit 2 squares into a rectangular suitcase, I thought m,n would be the dimensions of the suitcase. Are a & b the dimensions of 1 side of each of the squares?
Yes
OP solved it, closing
Hello, I enjoyed this kata very much and I'm very interested in others' solutions. BUT I still don't have access to solutions of other users. ("Solutions have been withheld Since you have not yet solved this kata we have hidden the solutions from you. If you choose to view the solutions you will forfeit your eligibility to earn honor/rank progress for this kata.") I have this kata among Completed, I received honor for this kata... Can anyone help me with this, please? I didn't have this problem with other katas, neither before nor after this one. Thanks!
Maybe you are trying to look at the solutions for a language you haven't solved the kate for?
Try resubmitting. If this doesn't help, nothing will (the bug fix is still WIP).
Thank you both very much.
I get this sort of thing all the time. Usually it's just a case of refreshing the screen/waiting a few minutes.
TypeScript Translation
Is there any hope these translations get approved?
JavaScript Translation
JavaScript identifiers ( including function names ) should be in camelCase, not snake_case.
Should it be updated at this point, making all solutions obsolete?
Yes.
Done
C# Translation
The amount of random tests is not enough to catch solutions that fails a tiny portion of edge cases.
Thanks for the feedback!
fit_in(6,5,8,7) == False
is missing in the fixed testsThanks for the feedback!
https://www.codewars.com/kata/reviews/5c5568d8504d5b0001a5a1a0/groups/5c556c035121460001e4b0ce
I have improve the test cases. Thanks for your reply!