What’s on the Grille
Jump to navigation
Jump to search
This problem asks you to decrypt a message written on a grid using a rotating "keyhole."
There isn't much challenge here other than some implementation tricks to make everything smooth
- parse the r,c indices of the "holes" in the input grid.
- check that there are n holes
- read out the characters in the string at the appropriate places (hint: it's r*n+c)
- mark the letter as "read"
- rotate the grid
- this is accomplished by mapping (r,c) to (c, 3-r) (0,1 -> 1,3 -> 3,2 -> 2,0)
- resort the elements
- a custom comparator makes this trivial
- repeat 4 times total
If you ever attempt to read a letter which was already read, fail.