Skip to content

Commit

Permalink
Update Swapper.java
Browse files Browse the repository at this point in the history
  • Loading branch information
VacancyIF authored Nov 23, 2023
1 parent bb33f85 commit d9f06b6
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/main/java/com/bytelegend/Swapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@

public class Swapper {
public static void swap(Point point) {
swap(point.x, point.y);
// swap(point.x, point.y);
int temp = point.x;
point.x = point.y;
point.y = temp;
}

public static void swap(int x, int y) {
int temp = x;
x = y;
y = temp;
}
// public static void swap(int x, int y) {
// int temp = x;
// x = y;
// y = temp;
// }
}

0 comments on commit d9f06b6

Please sign in to comment.