Initial implementation for sample solution.
Recursive implementation of shared.
Simplified implementation of difference.
Simple recursive implementation of difference.