Recognize a Complete Additive Digit Partition

Quick Overview

Recognize a Complete Additive Digit Partition. Return whether num can be split into at least three decimal numbers such that every number after the first two equals their sum. Use the entire digit string in

Recognize a Complete Additive Digit Partition

Company: Epic Systems

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Other

### Problem Return whether num can be split into at least three decimal numbers such that every number after the first two equals their sum. Use the entire digit string in order. Multi-digit numbers cannot begin with zero, but a single zero is valid. ```cpp bool isAdditiveNumber(string num); ``` ### Examples ```text num = "1235" -> true num = "1023" -> false ``` ### Constraints - num contains 1 through 35 decimal digits. ### Optional follow-up How would you handle overflow for very large input integers?

Overview: Recognize a Complete Additive Digit Partition. Return whether num can be split into at least three decimal numbers such that every number after the first two equals their sum. Use the entire digit string in

Epic Systems logo
Epic Systems
Source window: 0–3 months · as of Oct 21, 2026
mediumSoftware EngineerOtherCoding & Algorithms
0
0

Problem

Return whether num can be split into at least three decimal numbers such that every number after the first two equals their sum. Use the entire digit string in order. Multi-digit numbers cannot begin with zero, but a single zero is valid.

bool isAdditiveNumber(string num);

Examples

num = "1235" -> true
num = "1023" -> false

Constraints

  • num contains 1 through 35 decimal digits.

Optional follow-up

How would you handle overflow for very large input integers?