Split Array into Fibonacci Sequence
Memorial Day Problem: https://leetcode.com/problems/split-array-into-fibonacci-sequence/description/ Given a string S of digits, such as S = "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] <= 2^31 - 1 , (that is, each integer fits 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 . Also, note that when splitting the string into pieces, each piece must not have extra leading zeroes, except if the piece is the number 0 itself. Return any Fibonacci-like sequence split from S , or return [] if it cannot be done. One strategy to solve the problem is to do an N^2 nested-loop thru the array (given that the array length is 200, this would cost you 40,000, which is reasonable) where the outer-loop corre...