mirror of
https://github.com/TheAlgorithms/Java.git
synced 2026-03-13 08:40:43 +08:00
style: enable NeedBraces in checkstyle (#5227)
* enable style NeedBraces * style: enable NeedBraces in checkstyle --------- Co-authored-by: Samuel Facchinello <samuel.facchinello@piksel.com>
This commit is contained in:
committed by
GitHub
parent
51fcc66345
commit
87b17e0571
@@ -5,7 +5,9 @@ final class ZigZagPattern {
|
||||
}
|
||||
|
||||
public static String encode(String s, int numRows) {
|
||||
if (numRows < 2 || s.length() < numRows) return s;
|
||||
if (numRows < 2 || s.length() < numRows) {
|
||||
return s;
|
||||
}
|
||||
int start = 0;
|
||||
int index = 0;
|
||||
int height = 1;
|
||||
@@ -18,11 +20,11 @@ final class ZigZagPattern {
|
||||
boolean bool = true;
|
||||
while (pointer < s.length()) {
|
||||
zigZagedArray[index++] = s.charAt(pointer);
|
||||
if (heightSpace == 0)
|
||||
if (heightSpace == 0) {
|
||||
pointer += depthSpace;
|
||||
else if (depthSpace == 0)
|
||||
} else if (depthSpace == 0) {
|
||||
pointer += heightSpace;
|
||||
else if (bool) {
|
||||
} else if (bool) {
|
||||
pointer += depthSpace;
|
||||
bool = false;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user