Problem B1

Statement
Copy Copied
Description:
You are given N qubits (2 ≤ N ≤ 8) which are guaranteed to be in one of the two states:

- $${\left|0\dots0\right\rangle}$$ state, or
- $${ \left| W \right\rangle } = { \frac { 1 } { \sqrt { N } } } ( { \left| 1 0 0... 0 \right\rangle } + { \left| 0 1 0... 0 \right\rangle } + \ldots + { \left| 0 0... 0 1 \right\rangle } )$$ state. Your task is to perform necessary operations and measurements to figure out which state it was and to return 0 if it was $${\left|0..0\right\rangle}$$ state or 1 if it was W state. The state of the qubits after the operations does not matter.You have to implement an operation which takes an array of N qubits as an input and returns an integer. Your code should have the following signature:namespace Solution {    open Microsoft.Quantum.Primitive;    open Microsoft.Quantum.Canon;    operation Solve (qs : Qubit[]) : Int    {        body        {            // your code here        }    }}

Input Format:
None

Output Format:
None

Note:
None