Python Solution using List


#1

image