Cleaned up includes and added an alternative solution to 1018 that is not using subtrees' sizes.