ZhangZhihui's Blog  

2022年1月24日

摘要: def get_list_span(l: list): """ For list ['a', 'a', 'a', 'b', 'c', 'c', 'd', 'd', 'd', 'd'], its span list is [3, 0, 0, 1, 2, 0, 4, 0, 0, 0] . :param 阅读全文
posted @ 2022-01-24 11:53 ZhangZhihuiAAA 阅读(44) 评论(0) 推荐(0) 编辑
 
摘要: def get_dict_leaves_count(dic): """ If value of a key is a list, count all items in the list as leaves. :param dic: :return: """ if len(dic) == 0: ret 阅读全文
posted @ 2022-01-24 00:25 ZhangZhihuiAAA 阅读(17) 评论(0) 推荐(0) 编辑