Beta
LRU Cache with TTL Memoization
3 of 13GnomGad
Loading description...
Fundamentals
Algorithms
Memoization
Performance
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.
Apparently, values passed to the memoised function do not need to be distinguished between
null
,undefined
and<empty item>
. This needs to be specified.I don't know that I agree with calling
JSON.stringify
"optimal". At best it's a highly unqualified statement.Thanks for the feedback.
I'll update the advice to mention that JSON.stringify
can be used
(i agree it's not the optimal solution), and I'll clarify that there are no tests withnull
,undefined
, or<empty item>
.Is there anything else you'd like to add?
I will be waiting for your feedback after my update
https://www.codewars.com/kata/reviews/665673f617d0626f2404bed5/groups/665681becee572ced3319e78
Your function starts caching only after the 25th call. In our task, caching should start from the first call.
Your function does not consider the maximum cache size. The task requires automatic removal of the least recently used entries when the cache size exceeds the specified limit
Your function does not manage the time-to-live (TTL) for cached entries. The task requires that entries expire and are removed from the cache after the specified TTL.
Perhaps I misunderstood your expectations and you were looking for a different response from me. How else can I assist you?
I ran your code through my tests and saw a shortcoming on my end with the tests. I will fix it. Thx for issue!