Skip to content

Commit 92c5e45

Browse files
add some comments for this utils method
1 parent 3d659fd commit 92c5e45

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,13 @@ public static void print2DCharArray(char[][] arrayArrays) {
255255
}
256256

257257
public static int[][] convertLeetCodeArrayInputIntoJavaArray(String input) {
258+
/**
259+
* LeetCode 2-d array input usually comes like this:
260+
* [[448,931],[234,889],[214,962],[576,746]]
261+
* The expected input for this method is: "[448,931],[234,889],[214,962],[576,746]"
262+
* i.e. strip off the beginning and ending square brackets, that's it.
263+
* The output of this method will be a standard Java 2-d array.
264+
* */
258265
String[] arrays = input.split("],\\[");
259266
// CommonUtils.printArray_generic_type(arrays);
260267
int size = arrays[1].split(",").length;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy