题解 | #字符个数统计#

字符个数统计

https://www.nowcoder.com/practice/eb94f6a5b2ba49c6ac72d40b5ce95f50

strs = input()

hash_table = {}

for sub in strs:
    if not hash_table.get(sub):
        hash_table.setdefault(sub, 1)
    else:
        hash_table[sub] += 1
print(len(hash_table)) 

全部评论

相关推荐

彧未sr:查看图片
投递牧原集团等公司10个岗位
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
07-25 17:13
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务