# Petya loves lucky numbers. Everybody knows that lucky numbers are positive integers whose decimal representation contains only

1 Answer

New AnswerPetya has a number consisting of n digits without leading zeroes. He represented it as an array of digits without leading zeroes. Let's call it d. The numeration starts with 1, starting from the most significant digit. Petya wants to perform the following operation k times: find the minimum x (1 ≤ x < n) such that dx = 4 and dx + 1 = 7, if x is odd, then to assign dx = dx + 1 = 4, otherwise to assign dx = dx + 1 = 7. Note that if no x was found, then the operation counts as completed and the array doesn't change at all.

10/14/2021 11:42:11 AM

Lehan1 Answer

New Answer
Hot Today

How to rotate a number 180° in c++
Please why is my code not working,do I need to install any library
helpppp pls!! How to move duplicate value into seperate vectors?
Can someone debug this for me?
Can I use html to insert?
Should I memories STL functions syntax before leaning STL?
(ANSWERED)i tried to do the extra terrestrails code but i got it wrong can someone check my code .
Why does this output undefined? And how can I solve it?
How can I fix .../Playground/??
Why the value changed?

Sololearn Inc.

535 Mission Street, Suite 1591San Francisco, CA 94105

© 2022 Sololearn, Inc.

Send us a message