Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Hi there! 👋
I'm the author of this kata, but during beta testing, the warriors decided to make it 5 kyu. If you can influence the level of this kata, I would really appreciate it! 😊
Your solution should have O(n) time complexity to pass extra large tests
Thank you for your valuable feedback! The time complexity has been added to the task description. Unfortunately, the task's difficulty level is not set by the author; it is determined by the first solvers during the beta testing phase
Thanks for the comment! The task requires algorithms with a time complexity of O(n). To ensure that slower algorithms are not used, we need some way to check this. Very large input data is used for this purpose
Just to clarify, the problem statement ensures that the cost array will always have a length equal to or greater than the value of days. This means you won't encounter test cases where the cost array is shorter than the number of days, as in the example you mentioned.
Have you observed a scenario in random tests where money=10, days=2, and cost=[7]? In Python, the cost array's length is generated to be equal to or greater than the days value
Thank you for the valuable advice! This test has been added to the code
The word 'consecutive' was put in italics to make it more noticeable
The consecutive part of the task is illustrated by the test case (10, 2, [3, 7, 6]) -> money: 10
In the written random tests, the probability of responses with “money: …” and “days: …” is approximately equal. I point this out because calculating the response for “days: …” might take longer
Hello! For JavaScript, the maximum length of the cost array is 1.5 million, and the maximum length of the days array is 300,000
Thanks a lot! Changed as suggested. (data url)
Excellent!
Thank you for your contribution! It's been taken into account
Thanks for your remark! The word consecutive has now been highlighted in the task description
Loading more items...