game of two stacks hackerrank solution