How to generate 5-character strings combinations (1 digit, two equal letters and two different equal letters) without duplication
问题 I am trying to generate combinations of a 5-character strings consisting of four letters (exactly two are equal and another repeated two are equal) and one digit. Example for CORRECT combinations: 1aabb b1aab ca3ac Example for INCORRECT combinations: 1aaaa -> incorrect because there are more than 2 equal letters 1aaab -> Same as the previous 1abcd -> No 2 equal letters + 2 equal different letters This is the code I am using: from itertools import combinations, permutations, product LETTERS =