v1 of sol2. works for most test cases
passed cases