What is the 'two heaps' scheduling pattern used for in problems like 'maximize capital with k projects'?