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

Commit96ca744

Browse files
add notes for a utils method
1 parentd3cf905 commit96ca744

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ public static <T> void printArray_generic_type(T[] nums) {
2424
publicstaticvoidmain(String...strings) {
2525
Integer[]nums =newInteger[]{1,2,3,4,5};
2626
printArray_generic_type(nums);
27-
CommonUtils.printListList(convertLeetCode2DStringArrayInputIntoJavaArray("[\"A\",\"B\"],[\"C\"],[\"B\",\"C\"],[\"D\"]"));
27+
Stringinput1 ="[\"zDkA\",\"GfAj\",\"lt\"],[\"GfAj\",\"rtupD\",\"og\",\"l\"],[\"rtupD\",\"IT\",\"jGcew\",\"ZwFqF\"],[\"og\",\"yVobt\",\"EjA\",\"piUyQ\"],[\"IT\",\"XFlc\",\"W\",\"rB\"],[\"l\",\"GwQg\",\"shco\",\"Dub\",\"KwgZq\"],[\"oXMG\",\"uqe\"],[\"sNyV\",\"WbrP\"]";
28+
Stringinput2 ="[\"A\",\"B\"],[\"C\"],[\"B\",\"C\"],[\"D\"]";
29+
CommonUtils.printListList(convertLeetCode2DStringArrayInputIntoJavaArray(input1));
30+
CommonUtils.printListList(convertLeetCode2DStringArrayInputIntoJavaArray(input2));
2831
CommonUtils.print(convertLeetCode1DStringArrayInputIntoJavaArray("[\"abcsi\",\"abyzjgj\",\"advz\",\"ag\",\"agkgdkob\",\"agpr\",\"ail\"]"));
2932
CommonUtils.print2DIntArray(convertLeetCodeIrregularLengths2DArrayInputIntoJavaArray("[448,931,123,345],[889],[214,962],[576,746,897]"));
3033
}
@@ -387,6 +390,11 @@ public static int[][] convertLeetCodeIrregularLengths2DArrayInputIntoJavaArray(S
387390

388391
publicstaticList<List<String>>convertLeetCode2DStringArrayInputIntoJavaArray(Stringinput) {
389392
/**
393+
* How to copy LeetCode 2-d String array into this method:
394+
* 1. remove the beginning and ending quotes;
395+
* 2. put double quotes into this method parameter;
396+
* 3. copy the input into the double quotes.
397+
*
390398
* LeetCode 2-d array input usually comes like this: each row could have different length
391399
* [["A","B"],["C"],["B","C"],["D"]]
392400
* The expected input for this method is: "[\"A\",\"B\"],[\"C\"],[\"B\",\"C\"],[\"D\"]"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp