赞
踩
给定字符串数组 words 和字符串 chars,如果一个字符串在 chars 中可以找到对应的字符(每个字符只能使用一次),则该字符串是“好”的。要求:求出 words 中所有“好”字符串的字符总数。例如:words = ["cat", "bt", "hat", "tree"],chars = "atach",其中好的字符串有 "cat"、"hat",字符总数为 3 + 3 = 6,输出为 6。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。