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

Problem Description

Wavio is a sequence of integers. It has some interesting properties.

• Wavio is of odd length i.e. L = 2 ∗ n+ 1.

• The first (n+ 1) integers of Wavio sequence makes a strictly increasing sequence.

• The last (n+ 1) integers of Wavio sequence makes a strictly decreasing sequence.

• No two adjacen

...

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

Sample Input

10
1 2 3 4 5 4 3 2 1 10
19
1 2 3 2 1 2 3 4 3 2 1 5 4 1 2 3 2 2 1
5
1 2 3 4 5

Sample Output

9
9
1

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

Solution originally posted at: Github by @codingsince1985