Skip to content

Commit bbf6254

Browse files
update a util method
1 parent 53cdf2d commit bbf6254

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/main/java/com/fishercoder/common/utils/CommonUtils.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,8 @@ public static void print2DCharArray(char[][] arrayArrays) {
266266

267267
public static char[][] convertLeetCodeRegular2DCharArrayInputIntoJavaArray(String input) {
268268
/**LeetCode 2-d char array usually comes in like this:
269-
* [["#"," ","#"],[" "," ","#"],["#","c"," "]] which is wrapped in double quotes instead of single quotes which makes it not usable in Java code.
269+
* ["#"," ","#"],[" "," ","#"],["#","c"," "] which is wrapped in double quotes instead of single quotes which makes it not usable in Java code.
270270
* This method helps with the conversion.*/
271-
input = input.substring(1, input.length() - 1);
272271
String[] arrays = input.split("],\\[");
273272
// CommonUtils.printArray_generic_type(arrays);
274273
int m = arrays.length;

src/test/java/com/fishercoder/_2018Test.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public void test7() {
8181
@Test
8282
public void test8() {
8383
assertEquals(true, solution1.placeWordInCrossword(
84-
CommonUtils.convertLeetCodeRegular2DCharArrayInputIntoJavaArray("[[\"#\",\" \",\"#\"],[\" \",\" \",\"#\"],[\"#\",\"c\",\" \"]]"),
84+
CommonUtils.convertLeetCodeRegular2DCharArrayInputIntoJavaArray("[\"#\",\" \",\"#\"],[\" \",\" \",\"#\"],[\"#\",\"c\",\" \"]"),
8585
"abc"));
8686
}
8787

0 commit comments

Comments
 (0)