Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbbf6254

Browse files
update a util method
1 parent53cdf2d commitbbf6254

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
publicstaticchar[][]convertLeetCodeRegular2DCharArrayInputIntoJavaArray(Stringinput) {
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
intm =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
publicvoidtest8() {
8383
assertEquals(true,solution1.placeWordInCrossword(
84-
CommonUtils.convertLeetCodeRegular2DCharArrayInputIntoJavaArray("[[\"#\",\"\",\"#\"],[\"\",\"\",\"#\"],[\"#\",\"c\",\"\"]]"),
84+
CommonUtils.convertLeetCodeRegular2DCharArrayInputIntoJavaArray("[\"#\",\"\",\"#\"],[\"\",\"\",\"#\"],[\"#\",\"c\",\"\"]"),
8585
"abc"));
8686
}
8787

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp