Refactor code structure for system design problem and add a solution of
CatalanNumber