Just solved all HackerRank Python challenges on Closures and Decorators!

1 min read
def wrapper(f):
def fun(l):
f(["+91 "+ c[-10:-5]+" " + c[-5:] for c in l])
return fun
@wrapper
def sort_phone(l):
print(*sorted(l), sep='\n')
if __name__ == '__main__':
l = [input() for _ in range(int(input()))]
sort_phone(l)
0
Subscribe to my newsletter
Read articles from Bhuwan Sharma directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
