Adding test case and solution for cons
Test cases and solution to cons