codingbat
codingbat copied to clipboard
My way of doing this
I know this is more complicated than the OP's way of doing it but by doing this I learned how you have to go from "macro to micro" when it comes to if and else if statements. If you were you put the first if statement into the last else if statement, the code would not work because it needs to check the statement with the "macro" condition, which is (a == b && b == c && a == c).