| about | help | code help+videos | done | prefs |
A Social Security number consists of a 3-digit number, a dash, a 2-digit number, a dash, and a 4-digit number. Chop up a Social Security number, add up the three numeric pieces, and return the total. If the SSN is not in the correct format, it is invalid! If it is invalid, return -1. socialSecuritySum("456-56-2341") → 2853 socialSecuritySum("1-1-1") → -1 socialSecuritySum("10-122") → -1 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 150 Post-solution available
Copyright Nick Parlante 2017 - privacy