NC25072. [USACO 2007 Ope l]Camel Case Variables
描述
输入描述
Line 1: A camel-case variable name containing no blanks
输出描述
Lines 1..??: Each line shows the original camel case variable with one more upper-case letter removed
示例1
输入:
theRainInSpainFallsMainlyOnThePlain
输出:
theRainInSpainFallsMainlyOnhePlain theRainInpainFallsMainlyOnhePlain theainInpainFallsMainlyOnhePlain theainInpainFallsMainlyOnhelain theainInpainFallsMainlynhelain theainInpainFallsainlynhelain theainnpainFallsainlynhelain theainnpainallsainlynhelain
Python3 解法, 执行用时: 41ms, 内存消耗: 4600K, 提交时间: 2023-08-19 14:59:48
s = input().strip() arr =[c for c in s if c.isupper()] arr.sort(reverse=True) for c in arr: s = s.replace(c, '') print(s)