Question: Java Python Logic-2 > loneSum prev next | chance Given 3 int values, a b c, return their sum. However, if one of the values


Java Python Logic-2 > loneSum prev next | chance Given 3 int values, a b c, return their sum. However, if one of the values is the same as another of the values, it does not count towards the sum. loneSum(1, 2, 3) 6 loneSum(3, 2, 3) + 2 lone Sum(3, 3, 3) 0 Go ...Save, Compile, Run (ctrl-enter) public int loneSum(int a, int b, int c) { } Java Python Logic-2 > luckySum prev | next | chance Given 3 int values, a b c, return their sum. However, if one of the values is 13 then it does not count towards the sum and values to its right do not count. So for example, if b is 13, then both b and c do not count. luckysum(1, 2, 3) = 6 luckysum(1, 2, 13) - 3 luckysum(1, 13, 3) = 1 Go ...Save, Compile, Run (ctrl-enter) public int luckySum(int a, int b, int c) { }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
