We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please, consider replacing of this loop by the following code:
while (vm % 10 == 0) { vm /= 10; vr = vm; lastRemovedDigit = 0; ++removed; }
Also, I think that the same kind of loop can be optimized for 64-bit values too.
The logic behind this simplification is that after passing of vp / 10 > vm / 10 and vm % 10 == 0 checks it is guarantied that vr - vm < 5.
vp / 10 > vm / 10
vm % 10 == 0
vr - vm < 5
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Please, consider replacing of this loop by the following code:
Also, I think that the same kind of loop can be optimized for 64-bit values too.
The logic behind this simplification is that after passing of
vp / 10 > vm / 10
andvm % 10 == 0
checks it is guarantied thatvr - vm < 5
.The text was updated successfully, but these errors were encountered: