Solutions to the "Lambda Calculi - 9" HackerRank challenge