Alternative way to solve APAT1063.cpp