Finished Coinchange, LCS functions.