4 kyu
Circular Limited Sums
106 of 109Bubbler
Loading description...
Algorithms
Mathematics
Dynamic Programming
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.
JS translation
Approved by someone
This comment has been hidden.
Can you try again? Your solution is correct.
now it works, thanks! btw, input range looks easy, it could work for much bigger numbers with a little modification ;)
thank you for reporting this issue
since it's 4 kyu, perhaps we should increase range .. (edit: are you playing the edit-game again to make conversations very hard to trace back :p)
oh, excuse me =)
It depends on what ranges are ok for your solution, as mine is a result of looking at numbers without understanding of a problem per se
Both our solutions solve this in 2-3 seconds:
Mine has a limit around 11 seconds on below, your solve this in 5 seconds:
This comment has been hidden.
I think you should post it, I doubt a performance version will be authored. We do need to make sure that we also adapt the Python version if we decide to make this kata harder. Also, other users (including author) might not agree with making this kata really 4 kyu ;)
done (submitted the solution). maybe not the clearest code, but should be faster
impressive, 5 seconds for this heavy batch:
I'll use that as ref sol inside verification code
This comment has been hidden.
If you're on Discord, you might find some other opinions whether we should increase diff level of this kata. I agree that current performance requirements probably makes this more 5 kyu at the moment.
couldn't find a chat/thread there with that discussion. but you could ping me ( @twilight_sun ) if that makes sense. I have no certain opinion at the moment
ok, I'll post another.
it seems that kata needs a JS translation as well ;-)
Yep, but your solution in this kata should be made hidden by a mod ;)
yep, my first ones were already hidden. current one would not work for the 3kyu kata anyway
This comment has been hidden.
Doesnt make sense that circular_limited_sums(21,2) == 11841198, and circular_limited_sums(21,3) == 11261609; since all possible definitions with max_n = 21 and max_fn = 2 are also possible definitions with max_n = 21 and max_fn = 3, which means that circular_limited_sums(21,2) <= circular_limited_sums(21,3).
Answer is modulo 12345787.
Input range is given as
But
5 <= max_n <= 100
in the random tests. This means that input range1 <= max_n < 4, 3 <= max_fn <= 5
is not tested.Fixed.
In the last expanded example provided, is the entry
(1, 1, 1)
correct, despite the sum being> 2
?(1, 1, 1)
meansF(1) = F(2) = F(3) = 1
, and this is a valid case of F becauseOk, I think I get it now: thanks :+1: