Problem 42805. GJam 2016 Rd1A: Rank and File (small)

This Challenge is derived from GJam Rd1A 2016 Rank and File. This is the small case with max N=10

The GJam story is a matrix H(NxN) which has every row and column increasing. Each row and column is recorded on strips. The strips get scrambled and one gets incinerated. The goal is to reconstruct the missing increasing vector strip.

Input: [M], matrix of size [2*N-1,N] of all rows and columns of H except one

Output: [V], the missing vector of H not included in M

Examples: [M] [V]

[1 2 3;2 3 5;3 5 6;2 3 4;1 2 3] [3 4 6] 
[22 222;2 22;2 22][22 222] 

GJam 2016 Rd1A Matlab results show three qualifiers for Rd2.

Theory: With max N=10 it is possible to brute force the 50 puzzles. Persistent may be useful with the usage of nchoosek which may be the critical path. GJam Rank_file solutions. Writing the general solution for N=50 is better for the contest. The min corner or the max corner will always be available. Evolving solution, no guessing, is possible. OR one can observe an inherent mathematical result to create a 1-line solution.

Solution Stats

93.33% Correct | 6.67% Incorrect
Last Solution submitted on Apr 02, 2023

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers11

Suggested Problems

More from this Author296

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!