File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ public static String convert(String s, int numRows) {
47
47
if (numRows <= 1 )
48
48
return s ;
49
49
else {
50
- // traversing in zig zag pattern and storing the data of each row in hashtable as string
50
+ // traversing in zig zag pattern and storing the data of each row in hash map as string
51
51
for (int x = 0 ; x < s .length (); x ++) {
52
52
char ch1 = s .charAt (x );
53
53
String ch = Character .toString (ch1 );
@@ -62,25 +62,25 @@ public static String convert(String s, int numRows) {
62
62
} else {
63
63
map .put (pos , ch );
64
64
}
65
- // once reached the end of the row start moving upwards i.e decreasing the key in hash table
65
+ // once reached the end of the row start moving upwards i.e decreasing the key in hash map
66
66
pos --;
67
67
}
68
68
else if (pos == 0 || flag == 0 ) {
69
69
flag = 0 ;
70
- // check if the key in hash table has some data present
70
+ // check if the key in hash map has some data present
71
71
if (map .containsKey (pos )) {
72
72
String a = map .get (pos );
73
73
String w = a + ch ;
74
74
map .put (pos , w );
75
75
} else {
76
76
map .put (pos , ch );
77
77
}
78
- // keep increasing the key i.e pos in hash table till we reach at the end of the row
78
+ // keep increasing the key i.e pos in hash map till we reach at the end of the row
79
79
pos ++;
80
80
}
81
81
}
82
82
for (Map .Entry < Integer , String > e : map .entrySet ())
83
- // concatinate the values of each row of hash table
83
+ // concatinate the values of each row of hash map
84
84
word = word + e .getValue ();
85
85
86
86
return word ;
You can’t perform that action at this time.
0 commit comments