Program to solve the QR Code Challenge
"We found a very strange image and we suspect it is a kind of code, but we couldn't break yet. Are you capable to solve it?"
To solve this problem I figured out that I could crop the image in small squares and ensemble them like a jigsaw.
To do so, I used the data structure: Tree.
After obtaining the small squares the steps were the following:
Obtain the first line, knowing that a QR has 3 main squares.
Each piece of the puzzle had a color square that matches exactly with at most 2 more
Get the following line to verify the algorithm was working correct
Continue testing the algorithm, while seeing if the QR was appearing on the screen
Complete the jigsaw part of the algorithm. And magically I saw a QR, but I needed to remove those red lines and the color squares.
Removing the red lines
Tried to remove the color squares without success
Lastly, I tried another approach and a clean QR was ready to scan!
The QR is not working anymore but, after scanning it, a popup with a message appeared, and that was the code to solve the challenge.
To run this program locally, download the repository and run the file setup.sh. This file will do the whole installation for you.