ax (Japan) interview question

Coding exercise and open question for algorithm development