Little Elephant and Lucky Segment
The Little Elephant from the Zoo of Lviv likes lucky digits. Everybody knows that the lucky digits are digits 4 and 7. This time he has an array A that consists of N integers: A[1], A[2], ..., A[N]. Let F4(x) be the number of digits 4 in the decimal representation of x, and F7(x) be the number of digits 7 in the decimal representation of x. For example, F4(5) = 0, F4(4467) = 2 and F7(457747) = 3.
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start