Skip to content

Instantly share code, notes, and snippets.

View mm909's full-sized avatar
💭
Today I will be the world -- I think.

Mikian Musser mm909

💭
Today I will be the world -- I think.
View GitHub Profile
@mm909
mm909 / 1.1.3.py
Created April 16, 2020 05:30
1.1.3
def isUnique(str):
str = heapsort(str)
for i, char in enumerate(str[:-1]):
if char == str[i+1]:
return False
return True
@mm909
mm909 / 1.1.2.py
Created April 16, 2020 05:06
Problem 1.1.2
def isUnique(str):
if(len(str) > 26):
return False
hash = {}
for char in str:
if char in hash:
return False
else:
hash[char] = 1
@mm909
mm909 / 1.1.1.py
Created April 16, 2020 05:00
Problem 1.1 Solution 1
def isUnique(str):
for i, char1 in enumerate(str):
for j, char2 in enumerate(str):
if char1 == char2 and i != j:
return False
return True
Sequence_Length = 80
Step_Size = 4
sentences = []
next_chars = []
for i in range(0, len(text) - Sequence_Length, Step_Size):
sentences.append(text[i: i + Sequence_Length])
next_chars.append(text[i + Sequence_Length])