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.
Submitting an official solution before solving the problem yourself is a bannable offence.
Author:
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 , it can't end in , so you only have three conditions to check after swapping.
Comments