Created
November 19, 2017 03:26
-
-
Save karagenit/1347030506af039d3ab04929be152fc5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// TODO: fix imports | |
public class EfficientSwap { | |
/** | |
* This method should print its parameters in opposite order. | |
* E.g. swap(3, 4) should print 4 then 3. | |
*/ | |
public static void swap(int a, int b) { | |
a = a * b; | |
b = a / b; | |
a = a / b; | |
// NO MORE CODE BEYOND THIS POINT | |
System.out.println(a); | |
System.out.println(b); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment