SSplunk·DSAEngineerTechnical Phone Screen
String Number Summation
Problem
Extract all numbers embedded in a garbled string and return their sum.
Example
"a12b3c45" -> 60
Constraints
- 0 ≤ |s| ≤ 10^5
Approach
Scan accumulating digit runs into integers. Reported Splunk question.
added 6 days ago