Skip to content

Commit 6db436c

Browse files
committedMar 5, 2022
feat: add rust solution to lc problem: No.0521
No.0521.Longest Uncommon Subsequence I
1 parent c5b4243 commit 6db436c

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed
 

Diff for: ‎solution/0500-0599/0521.Longest Uncommon Subsequence I/README.md

+13
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,19 @@ class Solution {
7878
}
7979
```
8080

81+
### **Rust**
82+
83+
```rust
84+
impl Solution {
85+
pub fn find_lu_slength(a: String, b: String) -> i32 {
86+
if a == b {
87+
return -1;
88+
}
89+
a.len().max(b.len()) as i32
90+
}
91+
}
92+
```
93+
8194
### **...**
8295

8396
```

Diff for: ‎solution/0500-0599/0521.Longest Uncommon Subsequence I/README_EN.md

+13
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,19 @@ class Solution {
7575
}
7676
```
7777

78+
### **Rust**
79+
80+
```rust
81+
impl Solution {
82+
pub fn find_lu_slength(a: String, b: String) -> i32 {
83+
if a == b {
84+
return -1;
85+
}
86+
a.len().max(b.len()) as i32
87+
}
88+
}
89+
```
90+
7891
### **...**
7992

8093
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
impl Solution {
2+
pub fn find_lu_slength(a: String, b: String) -> i32 {
3+
if a == b {
4+
return -1;
5+
}
6+
a.len().max(b.len()) as i32
7+
}
8+
}

0 commit comments

Comments
 (0)
Please sign in to comment.