# Algorithm related problems

Time：2021-3-3

## 1. Permutation problem

You need to use Python’s itertools module

``````import itertools
a=[1,2,3]

#Take, arrange (mathematical formula: A32)
for i in  itertools.permutations (a, 2): # 2 is taken twice. A can be a string or a list
print(i)

'''
(1, 2)
(1, 3)
(2, 1)
(2, 3)
(3, 1)
(3, 2)
'''

#Combination (mathematical formula: C32)
# for i in itertools.combinations(a,2):
#     print(i)
'''
(1, 2)
(1, 3)
(2, 3)
'''

#Permutation with put back (Cartesian product)
# for i in itertools.product(a,repeat=2):
#     print(i)

'''
(1, 1)
(1, 2)
(1, 3)
(2, 1)
(2, 2)
(2, 3)
(3, 1)
(3, 2)
(3, 3)
'''

#There are combinations to put back
# for i in itertools.combinations_with_replacement(a, 2):
#     print(i)
'''
(1, 1)
(1, 2)
(1, 3)
(2, 2)
(2, 3)
(3, 3)
'''``````

## Front end interview day 3 + 1 – 725

Today’s knowledge point (2021.04.10) — day 725（I’m going to ask questions, too) [html] In H5, what special features do you know about IOS system? [css] Tell me about your understanding of CSS painting API [js] What are the methods and rules for converting other types into strings in JS? [soft skills]Do you usually arrive on […]