how to sort a list by the number of elements of another list that is inside dict (Keys of dict are similar with elements of list that should be sorted) .
This is the list I want to sort: list_to_sort = ['a','b','c','d']
This is a dict with the elements: reference_dict = {'a':[1,0,0,1,0], 'b':[1,0,0,0,1,1], 'c':[1,1,1,1,0], 'd':[1,0,0,0,0]}
I should get list_after_sort = ['d','a', 'b', 'c']