(int a, int b)
| 3 | public class Question { |
| 4 | |
| 5 | public static int add(int a, int b) { |
| 6 | if (b == 0) return a; |
| 7 | int sum = a ^ b; // add without carrying |
| 8 | int carry = (a & b) << 1; // carry, but don�t add |
| 9 | return add(sum, carry); // recurse |
| 10 | } |
| 11 | |
| 12 | public static int randomInt(int n) { |
| 13 | return (int) (Math.random() * n); |
no outgoing calls
no test coverage detected