Skip to content

Instantly share code, notes, and snippets.

@DjaPy
Created March 26, 2020 21:27
Show Gist options
  • Save DjaPy/ff594f76d760770927f870443ff2f870 to your computer and use it in GitHub Desktop.
Save DjaPy/ff594f76d760770927f870443ff2f870 to your computer and use it in GitHub Desktop.
ya_back
def get_intersection_arrays(arr_1: list, arr_2: list) -> list:
st_1 = set(arr_1)
st_2 = set(arr_2)
return list(st_1 & st_2)
lst_1 = [1, 2, 3, 4, 5, 6]
lst_2 = [2, 4, 6, 8]
result_intersection = get_intersection_arrays(lst_1, lst_2)
print(result_intersection)
def del_zero(lst: list) -> list:
lst = list(set(lst))
del lst[0]
return lst
arr = [1, 0, 3, 2, 0, 4, 0, 5, 0]
print(del_zero(arr))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment