Skip to content

Instantly share code, notes, and snippets.

@Allianzcortex
Last active August 18, 2020 16:24
Show Gist options
  • Save Allianzcortex/621b871b0414a30665cb6355837de2b7 to your computer and use it in GitHub Desktop.
Save Allianzcortex/621b871b0414a30665cb6355837de2b7 to your computer and use it in GitHub Desktop.
Code Test for Urthecast
def fib(N):
if N == 0:
return 0
if N == 1:
return 1
return fib(N - 1) + fib(N - 2)
if __name__ == '__main__':
print(fib(10))
def calculate(original_list, add_list, delete_list):
s = list(set([x for x in original_list + add_list if x
not in delete_list]))
s.sort(key=lambda x: (-len(x), x))
return s
if __name__ == '__main__':
Original_List = ['one', 'two', 'three']
Add_List = ['one', 'two', 'five', 'six']
Delete_List = ['two', 'five']
print(calculate(Original_List, Add_List, Delete_List))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment