id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

zbaharav@kehillah.org quiz1-logic > socialSum
prev  |  next  |  chance

Given 3 input integers, return the sum of all 3 if none is equal to each other. If exactly two are equal, return the third number. If all three are equal, return -1.


socialSum(1, 2, 3) → 6
socialSum(1, 2, 2) → 1
socialSum(4, 4, 4) → -1

...Save, Compile, Run (ctrl-enter)

public int socialSum(int a, int b, int c) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 100

Copyright Nick Parlante 2017 - privacy