Describe the solution you'd like
Use lru_cache. Convert interval arrays to tuples for hashing purposes.
Should we have a method which turns caching on or off?
Additional context
[add any other context, code examples, or references to existing implementations about the feature request here]
# Your code here, if applicable