-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReverseWords2Test.java
More file actions
43 lines (35 loc) · 882 Bytes
/
ReverseWords2Test.java
File metadata and controls
43 lines (35 loc) · 882 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import org.junit.Test;
import java.util.HashMap;
import java.util.Map;
/**
* 151. 反转字符串中的单词
*/
public class ReverseWords2Test {
ReverseWords2 solver = new ReverseWords2();
@Test
public void test1(){
String s = "the sky is blue";
String res = solver.reverseWords(s);
System.out.println(res);
// blue is sky the
}
@Test
public void test2(){
String s = " hello world ";
String res = solver.reverseWords(s);
System.out.println(res);
// world hello
}
@Test
public void test3(){
String s = "a good example";
String res = solver.reverseWords(s);
System.out.println(res);
// example good a
}
@Test
public void test(){
StringBuilder res = new StringBuilder();
HashMap<Integer, Integer> map;
}
}