We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c10a237 commit 61efba5Copy full SHA for 61efba5
1357/A1.qs
@@ -0,0 +1,23 @@
1
+namespace Solution {
2
+ open Microsoft.Quantum.Intrinsic;
3
+
4
+ operation Solve (unitary : (Qubit[] => Unit is Adj+Ctl)) : Int {
5
+ mutable result = -1;
6
7
+ using (qs = Qubit[2]) {
8
+ X(qs[0]);
9
10
+ unitary(qs);
11
12
+ if (M(qs[1]) == One) {
13
+ set result = 0;
14
+ } else {
15
+ set result = 1;
16
+ }
17
18
+ ResetAll(qs);
19
20
21
+ return result;
22
23
+}
0 commit comments