Skip to content

Commit 0a6e33e

Browse files
committed
Removed trailing spaces and added braces
1 parent 7cdee73 commit 0a6e33e

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/main/java/com/thealgorithms/maths/ChineseRemainderTheorem.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
/**
66
* @brief Implementation of the Chinese Remainder Theorem (CRT) algorithm
77
* @details
8-
* The Chinese Remainder Theorem (CRT) is used to solve systems of
9-
* simultaneous congruences. Given several pairwise coprime moduli
10-
* and corresponding remainders, the algorithm finds the smallest
8+
* The Chinese Remainder Theorem (CRT) is used to solve systems of
9+
* simultaneous congruences. Given several pairwise coprime moduli
10+
* and corresponding remainders, the algorithm finds the smallest
1111
* positive solution.
1212
*/
1313
public final class ChineseRemainderTheorem {
@@ -48,9 +48,13 @@ public static int solveCRT(List<Integer> remainders, List<Integer> moduli) {
4848
* @return The modular inverse of a modulo m.
4949
*/
5050
private static int modInverse(int a, int m) {
51-
int m0 = m, x0 = 0, x1 = 1;
51+
int m0 = m;
52+
int x0 = 0;
53+
int x1 = 1;
5254

53-
if (m == 1) return 0;
55+
if (m == 1) {
56+
return 0
57+
};
5458

5559
while (a > 1) {
5660
int q = a / m;

0 commit comments

Comments
 (0)