# 2-3 tree: Sum of leaves in a given range

I am implementing a 2-3 tree, where every leaf has a unique key and a value, and I need to write an algorithm which finds the sum of values of the leaves which their key is within a given interval. The time complexity of the function needs to be $$O(\log n)$$.

I thought about saving for each internal node the sum of the leaves in its subtree, but I don't know how to continue from there.