Here i am trying to append in a dict. if key exist or else create a new list and then append. Using get() function.
But its giving error of 'NONE Type objects.
class Solution:
def solve(self, A, B):
save_x={}
save_y={}
l=len(A)
for i in range(l):
save_x[A[i]]=save_x.get(A[i],[]).append(B[i])
save_y[B[i]]=save_y.get(B[i],[]).append(A[i])
print(save_x,save_y)