← Back to challenges

Break Point

PythonHardarraysloopsvalidation

Instructions

A number has a breakpoint if it can be split in a way where the digits on the left side and the digits on the right side sum to the same number.

For instance, the number 35190 can be sliced between the digits 351 and 90, since 3 + 5 + 1 = 9 and 9 + 0 = 9. On the other hand, the number 555 does not have a breakpoint (you must split between digits).

Create a function that returns True if a number has a breakpoint, and False otherwise.

Examples

break_point(159780) ➞ True

break_point(112) ➞ True

break_point(1034) ➞ True

break_point(10) ➞ False

break_point(343) ➞ False

Notes

  • Read each digit as only one number.
python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.