Skip to content

Commit

Permalink
Update Challenge.java (#95)
Browse files Browse the repository at this point in the history
Update Challenge.java (#95)

Co-authored-by: GL <[email protected]>
  • Loading branch information
ByteLegendBot and williamgl committed Jul 8, 2023
2 parents 8e633c5 + 8cecb68 commit 5c0b902
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/bytelegend/Challenge.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static void main(String[] args) {
* (`+`).
*/
public static int multiplyBy31(int n) {
return 0;
return (n << 5) - n;
}

/**
Expand All @@ -32,6 +32,6 @@ public static int multiplyBy31(int n) {
* addition sign (`+`).
*/
public static int divideBy2ThenMinus1(int n) {
return 0;
return n >= 0 ? (n >> 1) - 1 : (n - 1) >> 1;
}
}

0 comments on commit 5c0b902

Please sign in to comment.