Note that the memory limit is unusual.
Help, I've been trapped in a magical seal!
There is an array $$$a$$$ with $$$n$$$ integers. In one operation, you can choose $$$1\le i\le n - 1$$$ and either:
The seal becomes broken as soon as there is an index $$$i$$$ such that $$$a_i = 0$$$. Determine the minimum number of operations required to break the seal, or output $$$-1$$$ if you can never escape!
$$$^{\text{∗}}$$$$$$\oplus$$$ denotes the bitwise XOR operation.
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 10$$$). The description of the test cases follows.
The first line of each test case contains a single integer $$$n$$$ ($$$1\le n\le 100$$$) — the number of elements in the array.
The second line contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$0 \le a_i \lt 2^{25}$$$) — the elements of $$$a$$$.
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$100$$$.
For each testcase, output a single integer: the minimum number of operations required to break the seal, or $$$-1$$$ if it is impossible.
531 2 144 2 3 151 2 4 8 1630 1 211234
32-10-1
In the first example, we may do the following sequence of operations:
In the third example, we can prove that no sequence of operations breaks the seal.