842. Split Array into Fibonacci Sequence
You are given a string of digits num, such as "123456579". We can split it into a Fibonacci-like sequence [123, 456, 579]. Formally, a Fibonacci-like sequence is a list f of non-negative integers such that: - 0 <= f[i] < 231, (that is, each integer fits in a 32-bit signed integer type), - f.length >= 3, and - f[i] + f[i + 1] == f[i + 2] for all 0 <= i < f.length - 2. Note that when splitting
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