Skip to content

Latest commit

 

History

History
20 lines (16 loc) · 376 Bytes

File metadata and controls

20 lines (16 loc) · 376 Bytes

Description

  • create a simple method int Add(string numbers)
  • handle an unknown amount of numbers and return their sum (default delimiter is ",")
  • use 0 for empty or invalid values

Sample

Input: "1,2,3" Output: 6
Input: "" Output: 0
Input: "1, " Output: 1
Input: "abc,2" Output: 2

Extentions

  • Support different delimiters.
Input: "1#2#3" Output: 6