This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Solution { | |
public List<List<String>> findDuplicate(String[] paths) { | |
Map<String, List<String>> map = new HashMap<>(); | |
for(String path : paths) { | |
String[] pathArr = path.split(" "); | |
String dir = pathArr[0] + '/'; | |
for (int i = 1; i < pathArr.length; i++) { | |
int start = pathArr[i].indexOf('('); | |
String fileName = dir + pathArr[i].substring(0, start); | |
String content = pathArr[i].substring(start + 1, pathArr[i].length() - 1); |