5 kyu
Dating with hypergamy
19 of 85balygaby
Loading description...
Algorithms
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 desc is awesome
Half of the time spent was on understanding the description. I do not propose any suggestion to improve it because sometimes trying to figure out a little bit of unknown in this website was something we appreciated.
This sentence is confusing. What does it mean by "never settle for a man who's not at least 2 levels above their own"? There are no dating orders mentioned at all in the kata. Plus there is this sentence as well:
Then every woman would just choose the man with the highest number, and the sentence cited above becomes pointless. This part needs clarification.
Obviously, both parties have to agree on dating, so even if a woman wants a man, he has a say too. If he can get a better chick, he'll go for that instead. "never settle for a man who's not at least 2 levels above their own" means that a women who's a 5 will only date men 7 or above. The general dating order is stated at the end in your second quote. Please clarify more what is not understandable.
'Men of level 8 or above (aka Chads) try to get 2 women, men below that are content with one' 'When women have a choice between two equally glamorous Chads, they prefer the one without a girlfriend'
so if there are two equally glamorous Chads, what will happen? both gets one or how? i don't quite understand
Depends how many women there are. When there are two 10 Chads and two women, both Chads get one chick (the first chick chooses one Chad randomly, the other picks the one without a girlfriend, so the other Chad). But if there is a 9 and a 10 Chad, the 10 gets both girls, and the 9 is left with his hand.
but if there are two 10 chads and 3 chicks, can one of them get 2 chicks?
'When women have a choice between two equally glamorous Chads, they prefer the one without a girlfriend'
considering the first has a girlfriend already, so he's no longer part of the choice
also i'm a bit confused with several of the tests. an example: men, [ 10, 10, 9, 9, 8, 8,8, 7, 7, 6, 6, 3,3, 3, 2, 1],sorted already, and the women,[9, 7, 7, 7,6, 5, 1, 1], should deeply equal [ 1, 2, 3, 3, 3, 6, 6, 7, 7, 8, 8, 8 ]. so two 10 Chads and two 9 Chads paired up with 8 women?
Yes
I wonder about cases were we have for instance 1 woman (9) and 2 chads (9). Which of the two gets the woman? There is no tie breaker for these cases, and I passed the tests without implementing any tiebreaker. Are tests designed we needen't to worry about such cases at all ever happening?
Well, it doesn't matter, right? At the end of the day, the question is how many guys are left with their cock dry, no which ones.
Redpilled kata
Haskell translation
( JS )
The reference solution is a mess of undeclared variables and changes its inputs. User can also modify inputs.
I tried to improve balygaby's reference solution and test cases in this regard. Please check.
Reference solution looks fixed. User can still modify inputs. I'll add a couple of
[... ]
there also. Wait one.OK, fixed in the editor.
Renamed reference solution to sensible name, because in JS test suite is inaccessible from user solution.
@Welpy, you apparently also changed the example solution. That wasn't necessary.
Yeah, I realized it afterwards too. However, learned some new things tonight, not only about JS's intricacies. Thank you!
Wtf?!😂😂😂
wtf
Very fun kata, makes me laugh
I think there's a problem with the random tests in JavaScript. Only the random tests are wrong, as they present the array I'm returning in reverse order, even though I am sorting it and it's correct in the other tests.
At the time of raising an issue, you should provide clear examples of what you think are failed tests, with at least inputs, outputs and logs. Without this it's impossible to do anything.
This comment has been hidden.
I just finished the JS version without issue and my sorting is correct. I'm going to resolve this issue and conclude that it's very likely an issue with your code @EKrionasLamprou
It wasn't an issue with his code. The reference solution, which was called after the user solution, was modifying ( reversing ) its inputs.
Very, very sloppy kata design. Now fixed ( see above ).
Having the same issue. Only the two random tests fail, which appear after you passed all the declared tests. Moreover, these extra tests do not even provide their testing input, only the expected result. Quite frustrating.
Are you sure it's fixed? I'm still having the same problem with the arrays orders :/
Are you sure that you return a sorted list even if you have to return the whole men list (when all are ugly)?
Approved.
hell yes. thank you
Sorry, this function naming thing had been messed up, I'll try to fix it
Now I realized, there is nothing wrong with the kata. The function "guys_alone_from_group(men, women)" takes two arguments, but you tried to call it with only one.
Python:
OK, I fixed the cheat, and changed the name. What do you think now?
From proper naming convention, I mean the name of the function should be in
snake_case
You can read more on that here: https://www.python.org/dev/peps/pep-0008/right, i forgot to change it in the solution setup now it is fine
You've kicked out the valid solutions, use
try: .. except:...
instead.