about | help | code help+videos | done | prefs |
Write a method that returns the sum of the two input parameters, except if the sum ends with zeros, return the value without those zeros. So if the sum is 500, only return 5. But if the sum is 720, return 72. However, if the sum comes out negative, simply return that sum regardless of the result. Look at the test data for further examples. You are not allowed to use any string methods in this problem. dec18_2015_APSLHL_findSum(17, 3) → 2 dec18_2015_APSLHL_findSum(452, 48) → 5 dec18_2015_APSLHL_findSum(700000, 0) → 7 ...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: 250
Copyright Nick Parlante 2017 - privacy