自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(7)
  • 收藏
  • 关注

原创 简易年会抽奖程序

【代码】小的抽奖程序。

2024-02-05 19:51:08 102

原创 2021-06-18

输入:words = ["smooth","common","moorings"]输出:"moo",其他如 "omo", "oom" 也是正确答案。解释:m 在 "smooth" 中出现 1 次,在 "common" 中出现 2 次,在 "moorings" 中出现 1 次,所以只有 1 个 m 符合要求。o 在 "smooth" 中出现 2 次,在 "common" 中出现 2 次,在 "moorings" 中出现 2 次,所以 2 个 o 均符合要求。其他字符没有在 words 的每个字符串中

2021-06-18 00:05:34 582

转载 排序算法总结

1. 冒泡排序

2021-06-17 22:51:56 145

原创 [LeetCode] Word Ladder 词语阶梯 BFS

class Solution {public: int ladderLength(string beginWord, string endWord, vector<string>& wordList) { unordered_set<string> wordSet(wordList.begin(), wordList.end()); if (!wordSet.count(endWord)) return 0; uno.

2021-05-03 17:09:21 69

原创 Python 读取文本中的单词

# -*- coding:utf-8 -*- import io import re class Counter: def __init__(self, path): """ :param path: 文件路径 """ self.mapping = dict() with io.open(path, encoding="utf-8") as f: data = f.read() words = [s.lower() for s in re.findall("\.

2021-05-01 16:47:12 2577

转载 Python 实现BFS

Breadth First Search in Pythongraph = { 'A' : ['B','C'], 'B' : ['D', 'E'], 'C' : ['F'], 'D' : [], 'E' : ['F'], 'F' : []}visited = [] # List to keep track of visited nodes.queue = [] #Initialize a queuedef bfs(visited, graph, node

2021-05-01 16:44:34 301

转载 Python yield Keyword

link:https://stackoverflow.com/questions/231767/what-does-the-yield-keyword-doTo understand whatyielddoes, you must understand whatgeneratorsare. And before you can understand generators, you must understanditerables.IterablesWhen you create a ...

2021-04-23 15:57:41 81

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除