We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6559841 commit 347f5e7Copy full SHA for 347f5e7
README.md
@@ -10,6 +10,8 @@ leetcode 测试
10
11
##### 包含的内容如下
12
13
+https://leetcode.cn/problems/check-if-numbers-are-ascending-in-a-sentence/
14
+
15
https://leetcode-cn.com/problems/student-attendance-record-i/
16
17
https://leetcode.cn/problems/student-attendance-record-ii
check-if-numbers-are-ascending-in-a-sentence/index.ts
@@ -0,0 +1,5 @@
1
+export default function areNumbersAscending(s: string): boolean {
2
+ return (s.match(/\d+/g) ?? []).map(Number).every((v, i, a) =>
3
+ i === 0 || v > a[i - 1]
4
+ );
5
+}
0 commit comments