← 返回 optiver 的题目列表Add Subscripts to Duplicate Packages and Output YAML Dependencies
类型:online_judge
optiver
Given a list of packages [A,B,C,A,C,A], you need to save all dependencies in a YAML format. When there are duplicate packages, add a subscript to the string, for example, generate a new list [A,B,C,A1,C1,A2]. Write a Python program to achieve this.
Example
Input
A B C A C A