Coding Interview Workshop

preview_player
Показать описание
Coding interview workshop given at Le Wagon coding boot camp in Lisbon. We first go though a short introduction and then see 4 simple coding puzzles.
Solutions for the above are under the branch "solutions"

Please support me through my Udemy courses:
Multithreading in,

Pass your coding interview in,

Learn Dynamic Programming in,
Рекомендации по теме
Комментарии
Автор

Good job, i appreciate what you collect and transferred ur knowledge

dinakarmaurya
Автор

Python code for the array rotation:
Solution 1 :

def rotate(a, k):
n = len(a)
i = 1
while (i <= k):
a.insert(0, a.pop(n-1))
i += 1
return a


Solution 2:
def rotatewithanotherarray(a, k):
rotatedarray = [0]* len(a)
for i in range(len(a)): rotatedarray[(i + k) % len(a)] = a[i]
return rotatedarray


Any problem with the first solution?

airphilosopher
Автор

Python 3 code for the first problem:


def is_anagram(s, t):
worddict = {}
for schar in s:
if schar in worddict:
worddict[schar] = worddict[schar] + 1
else:
worddict[schar] = 1
for tchar in t:
if tchar in worddict:
worddict[tchar] = worddict[tchar] - 1
if(worddict[tchar] == 0):
del worddict[tchar]
if bool(worddict):
return False
else:
return True

airphilosopher
Автор

The questions are not very clear in this video.

airphilosopher