Skip to content

Instantly share code, notes, and snippets.

View seanhuggins1's full-sized avatar
🐝
Building Hiive

Sean Huggins seanhuggins1

🐝
Building Hiive
View GitHub Profile
def lookAndSay(N):
s = '1'
for k in range(N):
print(s)
i = 0
count = 0
prev = s[0]
snew = ''
def matchString(string, pattern):
i = 0
while i < len(string):
k = 0
while k < len(pattern):
if (string[i + k] == pattern[k]):
k += 1
continue
def testBit(int_type, offset):
mask = 1 << offset
return(int_type & mask)
def checkUTF(arr):
i = 0
while (i < len(arr)):
char = arr[i]
visited = set();
def dfs(visited, graph, node):
if node not in visited:
yield node
visited.add(node)
for neighbor in graph[node]:
yield from dfs(visited, graph, neighbor)
def printFriendGroups(graph):