# Find Arrays In An Array

**Computer Science**Level 5

In a given array, find the number of sub-arrays that have the following properties:

- The first and the last number of sub-array is the same.
- A sub-array has more than one number in it.

Submit number of such sub-arrays as answer.

The array is described in file **AinA.txt**. First number (\( 10^{5} \)) is the number of elements in the given array. The rest of it are numbers that go in the array.

Example with array of 8 elements.

Array: 3 1 7 5 5 7 3 7

\[\]

## \[\]

**Input Format and Details:**

- Link to input
- The first line contains \(N\). The next line contains \(N\) space seperated integers which constitute the array.
- All integers, including the answer are less than \(10^9\)

Questions can be asked here.