microsoft/qdk

Public

mirrored fromhttps://github.com/microsoft/qdkAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
copilot/replace-qsharp-with-qdk-python-tests

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

katas/content/key_distribution/random_array/Solution.qs

11lines · modecode

1namespace Kata {
2 import Std.Random.*;
3
4 operation RandomArray(N : Int) : Bool[] {
5 mutable array = [false, size = N];
6 for i in 0..N - 1 {
7 set array w/= i <- DrawRandomInt(0, 1) == 0;
8 }
9 return array;
10 }
11}
12