← All problemsSign in

FIB_WRD

For any two strings of digits, A and B, we define FA,B to be the sequence (A,B,AB,BAB,ABBAB,...) in which each term is the concatenation of the previous two. Further, we define DA,B ( n ) to be the nth digit in the first term of FA,B that contains at least n digits. Example: Let A=1415926535, B=8979323846. We wish to find DA,B (35), say. The first few terms of FA,B are: 1415926535 8979323846

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start