Content-Length: 270023 | pFad | http://github.com/AlgoStudyGroup/Leetcode/commit/8b8e04547b79cea2491cf9f837cf9dcf7a540f5f

49 Add C# solutions · AlgoStudyGroup/Leetcode@8b8e045 · GitHub
Skip to content

Commit 8b8e045

Browse files
committed
Add C# solutions
1 parent 9bb31e9 commit 8b8e045

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
public class Solution {
2+
public IList<string> FindRepeatedDnaSequences(string s) {
3+
if(s == null || s.Length == 0) return new List<string>();
4+
var seen = new HashSet<string>();
5+
var repeated = new HashSet<string>();
6+
for(int i=0; i<s.Length-9; i++){
7+
string curr = s.Substring(i, 10);
8+
if(!seen.Add(curr)){
9+
repeated.Add(curr);
10+
}
11+
}
12+
return new List<string>(repeated);
13+
}
14+
}

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/AlgoStudyGroup/Leetcode/commit/8b8e04547b79cea2491cf9f837cf9dcf7a540f5f

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy