GoLang Solution For LeetCode Problem: Additive Number
Solving Additive Number in go. Please try yourself first to solve the problem and submit your implementation to LeetCode before looking into solution.
Problem Description
Additive number is a string whose digits can form additive sequence.
Example 1:
Input: "112358"
Output: true
Explanation: The digits can form an additive sequence: 1, 1, 2, 3, 5, 8.
1 + 1 = 2, 1 + 2 = 3, 2 + 3 = 5, 3 + 5 = 8
Example 2:
Input: "199100199"
Output: true
Explanation: The additive sequence is: 1, 99, 100, 199.
1 + 99 = 100, 99 + 100 = 199
**Follow up:**How would you handle overflow for very large input integers?
See the full details of the problem Additive Number at LeetCode
Originally posted at: @github.com/halfrost/LeetCode-Go
Comments
Leave a comment
You are not LoggedIn but you can comment as an anonymous user which requires manual approval. For better experience please Login.