5 kyu
What Would They Have in Common?
50 of 85raulbc777
Loading description...
Mathematics
Strings
Data Structures
Sorting
Performance
Algorithms
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.
Just an observation -> JS reference solution uses 'Set.prototype.intersection', which I also happened to provide. This gave weird errors, as my method suddenly got used in the reference solution.
Please use new python test framework.
Done.
Great as always :)
This comment has been hidden.
this kind of solution should be automatically found and flagged as a cheat on the server side. Not sure that anything can be done about that n the author side (without being a pita)
...mmmmh... Or are you rather saying that the new test framework would ban this kind of cheat? (iirc, it should do so, but... not sure anymore)
Hi @lechevalier and @Blind4Basics. I saw today what this cheater did. This has to be reported
@B4B
it should prevent this kind of solution due to closure, isn't it?@raulbc
when you have some time, can you replace test cases with new testing framework flavour while there isn't many solutions please?nope, nothing related. ;)
Damnit, I shoud have played with this testing framework!
I really enjoyed this, thanks! Trying to figure out how to optimize for the upper bound of 55000 was insane
Can be optimized to handle an upper bound of 1,000,000 once you found out what is the most time-consuming part.
1,000,000? It took me the better part of a slow day at work to optimize to 55,000 - and I work 12 hour days. Granted I've only been in Python for a month..
Agreed, there might be some math involved.
Approved ;-)
Thanks! Haha you were approving it and I was modifying the upper bound to 55000
B4B challenged me for a faster algorithm. We grow with challenges.
Since now the challenge will be one which performance matters. The upper_bound will be increased from 7.500 up to 55.000. Hope that you will enjoy it.
Go to one million :D
All the solutions up to now in Python were upvoted. Excellent work and thanks all for your time solving this kata.
JS random tests have no test assertions at all, which means nothing is being tested.
Thanks for the feedback. I was working on it and forgot to add the command for the tests
This issue was fixed. Let me know any further detail that should be fixed.
Description says
but in JavaScript
the kata is currently being modified, accordingly to the discussion below and in the forks related to my python solution. The python version is still to be updated, and Raul will surely update the description at that moment.
I let it opened so that other people can see the "problem", but it's actually not an issue.
Tests are now like the description says.
Upt to 7500 in Python and Javascript.
An interesting kata, finding out all along the way the need of optimization... Well, finally, I put in there all the ideas I could have... x)
Thanks I'll see your solution.
Hi, I'm working in the performance of this one.
This comment has been hidden.
This comment has been hidden.
Up to now only micro optimizations. n max extended to 9.000
tell me when you're done with the modifications. ;)
Sorted now, thanks, another good one.
Congrats. You were the first one in solving it!
I saw the leaderboard, your progress is very impressive. You're doing a great job!! :)
Thank you. I am seeing how far I can get on python alone. I am an amateur coder.
me too ;-)
So do I, haha. :)
myjinxin2015, I wonder, how can you produce so many good katas? I like them and I'm solving some of the Simple fun series.
In order to occupy the earth :P
To be honest, I'm not interested in solving this kata. I'm only interested in the following text:
9500 is meaningless, because
a
can not be in the range of8001-9500
. Because ofalways a < b
andmax(b) is 8000
;-)Oh, thanks for your observation. I'll fix it
Fixed now!
Hi there,
I pass the sample tests, but get 'NameError: global name 'chain' is not defined' when attemoting the full set.
Hi daddepledge. Try now and let me know if everything is ok.
Thanks, fixed. I now need to work my solution which times out.
Issue solved.