58 Star 717 Fork 331

doocs/leetcode

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
Solution.rs 398 Bytes
Copy Edit Raw Blame History
YangFong authored 2022-11-17 15:20 +08:00 . feat: add solutions to lc problem: No.0392
impl Solution {
pub fn is_subsequence(s: String, t: String) -> bool {
let (s, t) = (s.as_bytes(), t.as_bytes());
let n = t.len();
let mut i = 0;
for &c in s.iter() {
while i < n && t[i] != c {
i += 1;
}
if i == n {
return false;
}
i += 1;
}
true
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/Doocs/leetcode.git
[email protected]:Doocs/leetcode.git
Doocs
leetcode
leetcode
main

Search