about | help | code help+videos | done | prefs |
Write a method that returns the difference between the one's places of the two input parameters, but only if both of those parameters are positive. If either or both of them are negative or zero, return -1 as an error code. For example, with the input values of 75 and 23, return 2 because the difference between 5 and 3 (the numbers in the one's places) is 2. Please look at the test data for additional examples. You are NOT allowed to use ANY string methods or operations in solving this problem. nov20_2015_APSLHL_differenceOnesPlace(925381, 428) → 7 nov20_2015_APSLHL_differenceOnesPlace(142, 634) → 2 nov20_2015_APSLHL_differenceOnesPlace(7, 54007) → 0 ...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