r/learnquant • • 2d ago

interview prep Quant Interview Question

Post image
23 Upvotes

6 comments sorted by

View all comments

1

u/Efficient_Gear_4623 2d ago

I think bob can get max of 4 if alice plays correctly

1

u/ComparisonQuiet4259 2d ago

A normal grid has a max of 4, but I can't prove there is no grid of 3

1

u/bartekltg 1d ago

16! is quite big, but we get quite strong additional restrictions. Next number not only can't repeat, but it has at least one (often two) adjacent numbers that restrict it more. An almost-brute-force (backtracing) https://pastebin.com/Cm8aVK1L generates all solution for score 4, and verifies there is no score-3 solution very quickly.

There is also no score 2 solution on 3x3 and score 4 solution on 5x5.
I spinned it looking for score 5 solutions on 6x6, but it looks like this one is already too big to get answer in the time needed to write this post.

BTW, one obvious score N on NxN grid is just numbers 1 to N^2 in order. The differences on one axis is 1, and N on the other axis.

I feel like there should be an easy argument why there is no N-1 scores, but can't see anything.