Skip to content

Commit 57f30b2

Browse files
committed
update
1 parent 5bcf475 commit 57f30b2

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

code/192.统计词频.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#
2+
# @lc app=leetcode.cn id=192 lang=bash
3+
#
4+
# [192] 统计词频
5+
#
6+
7+
# @lc code=start
8+
# Read from the file words.txt and output the word frequency list to stdout.
9+
cat words.txt | tr -s ' ' '\n' | sort | uniq -c | sort -nr | awk '{print $2, $1}'
10+
# @lc code=end
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#
2+
# @lc app=leetcode.cn id=744 lang=python3
3+
#
4+
# [744] 寻找比目标字母大的最小字母
5+
#
6+
7+
# @lc code=start
8+
class Solution:
9+
def nextGreatestLetter(self, letters: List[str], target: str) -> str:
10+
t = ord(target)
11+
c = letters[0]
12+
n = ord(c) - t
13+
for letter in letters:
14+
o = ord(letter) - t
15+
if o > 0 and (o < n or n <= 0):
16+
c = letter
17+
n = o
18+
return c
19+
# @lc code=end
20+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#
2+
# @lc app=leetcode.cn id=746 lang=python3
3+
#
4+
# [746] 使用最小花费爬楼梯
5+
#
6+
7+
# @lc code=start
8+
class Solution:
9+
def minCostClimbingStairs(self, cost: List[int]) -> int:
10+
11+
# @lc code=end
12+

0 commit comments

Comments
 (0)