Game of Two Stacks, is a HackerRank problem from Stacks subdomain. In this post we will see how we can solve this challenge in Python

Problem Description

Alexa has two stacks of non-negative integers, stack and stack where index denotes the top of the stack. Alexa challenges Nick to play the following game:

In each move, Nick can remove one integer from the top of either stack or stack .

Nick keeps a running sum of the integers he removes from ....

You can find the full details of the problem Game of Two Stacks at HackerRank

Solution: Please check the snippet for the solution.

This solution originally posted at: Github by @srgnk