Can you share your approach for covid sampling question and respective points you got .

i used approach similar to jump search line by line taking bloock length sqrtN;

And can you plz tell me how to use probablity in these challenge problems ?

For each block you can find the largest matrix it will form where it will be on corner and then you can get the value of that particular block by adding the values of two matrix excluding its row and column separately and then subtracting the value of matrix excluding both row and column together

ex: if we want to find the value at (1,1) in matrix(1,1-5,5) we will do this

matrix(1,2-5,5) + matrix(2,1-5,5) - matrix(2,2-5,5)

similarly you can do this for all and you should have edge case for 2 by 2 matrix

1 Like

i thought this logic latter.

what my approach was simple

like ask the first block and then ask first two blocks then three together and make another matrix where you store sum till that block

1 Like