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

Problem Description

A permutation of n is a bijective function of the initial n natural numbers: 0, 1, . . . , n− 1. A permu- tation p is called antiarithmetic if there is no subsequence of it form- ing an arithmetic progression of length bigger than 2, i.e. there are no three indices 0 ≤ i < j < k < n such that (pi, p

...

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

Sample Input

3: 0 2 1
5: 2 0 1 3 4
6: 2 4 3 5 0 1
0

Sample Output

yes
no
yes

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

Solution originally posted at: Github by @codingsince1985