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
class Solution { | |
public List<String> crawl(String startUrl, HtmlParser htmlParser) { | |
// find hostname | |
int index = startUrl.indexOf('/', 7); | |
String hostname = (index != -1) ? startUrl.substring(0, index) : startUrl; | |
// multi-thread | |
Crawler crawler = new Crawler(startUrl, hostname, htmlParser); | |
crawler.result = new HashSet<>(); // reset result as static property belongs to class, it will go through all of the test cases |
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
just a test |
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
class Solution(object): | |
def uniquechar(self, string): | |
if string == '': | |
return True | |
string = sorted(string) | |
prev = string[0] | |
for char in string[1:]: | |
if char == prev: |