An implementation and demo of the MaxHeap data structure. Usually heaps are implemented using an array for storage, but I've heard this is bad news for caching. Here's a tree-based implementation. Run It Now!
A number is called lucky if the sum of its digits, as well as the sum of the squares of its digits is a prime number. How many numbers between A and B are lucky? Run It Now!