Editorial for BSSPC '22 P2 - Rhyming Numbers


Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.

Author: Riolku

Each pair can be handled independently. Although this problem can be done with strings, using the remainder/modulo operator is likely easier.

To reduce the amount of casework, you can swap the numbers if b % 7 == 0.

Also, note that if the number ends in 11, it can't end in 17, so you only have three conditions to check after swapping.


Comments

There are no comments at the moment.