Premium problem57. Place p Elements Randomly

Medium Locked

Randomly place p ones in an n x n array of zeros, at p distinct positions chosen uniformly at random without replacement. Seed the global random state with seed first: do it inside solve, immediately before the random call, since the seed is global, shared state.

Input

n = 10, p = 3, seed = 0

Premium problem

This one's part of Premium. Unlock the full NumPy track plus every other premium problem on the site.

Implement solve(...)