Beta

LRU Cache with TTL Memoization

3 of 13GnomGad
Description
Loading description...
Fundamentals
Algorithms
Memoization
Performance
  • Please sign in or sign up to leave a comment.
  • JohanWiltink Avatar
    JSON.stringify([undefined]) -> "[null]"
    JSON.stringify([,]) -> "[null]"
    

    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.

    • GnomGad Avatar

      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 with null, undefined, or <empty item>.

      Is there anything else you'd like to add?

    • GnomGad Avatar

      I will be waiting for your feedback after my update

      Issue marked resolved by GnomGad 12 months ago
  • Voile Avatar
    • GnomGad Avatar

      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?

    • GnomGad Avatar

      I ran your code through my tests and saw a shortcoming on my end with the tests. I will fix it. Thx for issue!

      Issue marked resolved by GnomGad 12 months ago