PHP implementation example of solving a simple activity scheduling problem using a top-down greedy algorithm