Skip to content

Commit 8e6d211

Browse files
Add files via upload
1 parent 35831a8 commit 8e6d211

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

camilo_sol.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Implement an algorithm to determine if a string has all unique charactersself.
2+
# What if you cannot use additional data structures.
3+
4+
5+
def isUnique(string_):
6+
for i in range(len(string_)):
7+
i = 0
8+
for j in range(1,len(string_)):
9+
if string_[i] == string_[j]:
10+
return False
11+
return True
12+
13+
print(isUnique("GeeksforGeeks"))
14+
#This soluation is O(n^2)
15+
16+
#let's see if we can go faster

0 commit comments

Comments
 (0)