GO Solution For UVa 10541 - Stripe. In this post we will see how we can solve this challenge in GoLang for UVa Online Judge.

Problem Description

You are given a rectangle 1×N , where its 1× 1 squares can be painted as white or black. So, one can build a “code” of this rectangle — this will be a sequence of numbers, the number of consequent black squares from left to right.

For example, the code of this rectangle is 2 3 2 8 1. However, the n


You can find the full details of the problem Stripe at UVa Online Judge

Sample Input

4 0
5 2 1 2
4 2 2 2

Sample Output


Solution: Please check the main.go snippet for the solution.

Solution originally posted at: Github by @codingsince1985