Skip to content

Commit 7f15791

Browse files
authored
Merge branch 'doocs:main' into main
2 parents df3b19c + c656e32 commit 7f15791

File tree

4 files changed

+46
-0
lines changed

4 files changed

+46
-0
lines changed

solution/2000-2099/2084.Drop Type 1 Orders for Customers With Type 0 Orders/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,15 @@ FROM Orders AS o
9292
WHERE order_type = 0 OR NOT EXISTS (SELECT 1 FROM T AS t WHERE t.customer_id = o.customer_id);
9393
```
9494

95+
```sql
96+
SELECT DISTINCT
97+
a.order_id,
98+
a.customer_id,
99+
a.order_type
100+
FROM
101+
Orders AS a
102+
LEFT JOIN Orders AS b ON a.customer_id = b.customer_id AND a.order_type != b.order_type
103+
WHERE b.order_type IS NULL OR b.order_type = 1;
104+
```
105+
95106
<!-- tabs:end -->

solution/2000-2099/2084.Drop Type 1 Orders for Customers With Type 0 Orders/README_EN.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,15 @@ FROM Orders AS o
8888
WHERE order_type = 0 OR NOT EXISTS (SELECT 1 FROM T AS t WHERE t.customer_id = o.customer_id);
8989
```
9090

91+
```sql
92+
SELECT DISTINCT
93+
a.order_id,
94+
a.customer_id,
95+
a.order_type
96+
FROM
97+
Orders AS a
98+
LEFT JOIN Orders AS b ON a.customer_id = b.customer_id AND a.order_type != b.order_type
99+
WHERE b.order_type IS NULL OR b.order_type = 1;
100+
```
101+
91102
<!-- tabs:end -->

solution/2500-2599/2520.Count the Digits That Divide a Number/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,18 @@ function countDigits(num: number): number {
132132
}
133133
```
134134

135+
```ts
136+
function countDigits(num: number): number {
137+
let ans = 0;
138+
for (const s of num.toString()) {
139+
if (num % Number(s) === 0) {
140+
ans++;
141+
}
142+
}
143+
return ans;
144+
}
145+
```
146+
135147
### **Rust**
136148

137149
```rust

solution/2500-2599/2520.Count the Digits That Divide a Number/README_EN.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,18 @@ function countDigits(num: number): number {
119119
}
120120
```
121121

122+
```ts
123+
function countDigits(num: number): number {
124+
let ans = 0;
125+
for (const s of num.toString()) {
126+
if (num % Number(s) === 0) {
127+
ans++;
128+
}
129+
}
130+
return ans;
131+
}
132+
```
133+
122134
### **Rust**
123135

124136
```rust

0 commit comments

Comments
 (0)