mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-23 04:20:16 +08:00
style: enable MultipleVariableDeclarations
in checkstyle (#5175)
Co-authored-by: vaibhav <vaibhav.waghmare@techprescient.com>
This commit is contained in:
@ -7,7 +7,9 @@ final class longestNonRepeativeSubstring {
|
||||
}
|
||||
|
||||
public static int lengthOfLongestSubstring(String s) {
|
||||
int max = 0, start = 0, i = 0;
|
||||
int max = 0;
|
||||
int start = 0;
|
||||
int i = 0;
|
||||
HashMap<Character, Integer> map = new HashMap<>();
|
||||
|
||||
while (i < s.length()) {
|
||||
|
@ -6,10 +6,15 @@ final class zigZagPattern {
|
||||
|
||||
public static String encode(String s, int numRows) {
|
||||
if (numRows < 2 || s.length() < numRows) return s;
|
||||
int start = 0, index = 0, height = 1, depth = numRows;
|
||||
int start = 0;
|
||||
int index = 0;
|
||||
int height = 1;
|
||||
int depth = numRows;
|
||||
char[] zigZagedArray = new char[s.length()];
|
||||
while (depth != 0) {
|
||||
int pointer = start, height_space = 2 + ((height - 2) * 2), depth_space = 2 + ((depth - 2) * 2);
|
||||
int pointer = start;
|
||||
int height_space = 2 + ((height - 2) * 2);
|
||||
int depth_space = 2 + ((depth - 2) * 2);
|
||||
boolean bool = true;
|
||||
while (pointer < s.length()) {
|
||||
zigZagedArray[index++] = s.charAt(pointer);
|
||||
|
Reference in New Issue
Block a user