about | help | code help+videos | done | prefs |
Write a method that accepts two integers as input parameters. The first integer, num, will be positive and have at least three digits. The second integer, splitAt, will be a single, positive digit. That digit will appear exactly once in the first number. The digit represented by splitAt will cut the num into two different parts. For example, 483251 with a splitAt of 2 will split the number into 483 and 51, the numbers that comes before and after splitAt. Return the sum of these numbers. So in the example above, you would return 534 because 483+51=534. Remember that the digit splitAt will only occur once in num. splitDigitSum(872, 7) → 10 splitDigitSum(254, 5) → 6 splitDigitSum(5600, 6) → 5 ...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: 290
Copyright Nick Parlante 2017 - privacy