Skip to content

Commit ed3b4db

Browse files
committed
add test
1 parent e2206a6 commit ed3b4db

File tree

5 files changed

+44
-0
lines changed

5 files changed

+44
-0
lines changed

Cargo.lock

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ members = [
1010
"merge_sorted_array",
1111
"intersection_of_two_arrays",
1212
"longest_palindromic_substring",
13+
"reverse_words_in_a_string_iii",
1314
]

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Resolving problems of LeetCode in RustLang.
1616
* [215. Kth Largest Element in an Array](./kth_largest/src/lib.rs)
1717
* [232. Implement Queue using Stacks](./implement_queue_using_stacks/src/lib.rs)
1818
* [349. Intersection of Two Arrays](./intersection_of_two_arrays/src/lib.rs)
19+
* [557. Reverse Words in a String III](./reverse_words_in_a_string_iii/src/lib.rs)
1920

2021
## Document
2122

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[package]
2+
name = "reverse_words_in_a_string_iii"
3+
version = "0.1.0"
4+
authors = ["Ryan Li <conbas2019@gmail.com>"]
5+
edition = "2018"
6+
7+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8+
9+
[dependencies]
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*!
2+
* # 557. Reverse Words in a String III
3+
*
4+
* [Problem link](https://leetcode.com/problems/reverse-words-in-a-string-iii/)
5+
*/
6+
7+
#![allow(dead_code)]
8+
9+
struct Solution {}
10+
11+
// ----------------------------------------------------------------------------
12+
13+
impl Solution {
14+
pub fn reverse_words(s: String) -> String {
15+
"".to_string()
16+
}
17+
}
18+
19+
#[cfg(test)]
20+
mod tests {
21+
use super::*;
22+
23+
#[test]
24+
fn test_example_1() {
25+
let input = "Let's take LeetCode contest".to_string();
26+
let output = "s'teL ekat edoCteeL tsetnoc".to_string();
27+
assert_eq!(Solution::reverse_words(input), output);
28+
}
29+
}

0 commit comments

Comments
 (0)