|
1 | 1 | @testset "139.word-break.jl" begin
|
2 |
| - @test word_break("leetcode", ["leet", "code"]) == true |
3 |
| - @test word_break("catsandog", ["cats", "dog", "sand", "and", "cat"]) == false |
4 |
| - @test word_break("applepenapple", ["apple", "pen"]) == true |
5 |
| - @test word_break("a", ["b"]) == false |
6 |
| - @test word_break("a"^150 * "b", ["a"^i for i in 1:10]) == false |
7 |
| - @test word_break("bb", ["a", "b", "bbb", "bbbb"]) == true |
| 2 | + tcase1 = ("leetcode", ["leet", "code"]) |
| 3 | + tcase2 = ("applepenapple", ["apple", "pen"]) |
| 4 | + tcase3 = ("bb", ["a", "b", "bbb", "bbbb"]) |
| 5 | + fcase1 = ("catsandog", ["cats", "dog", "sand", "and", "cat"]) |
| 6 | + fcase2 = ("a", ["b"]) |
| 7 | + fcase3 = ("a"^150 * "b", ["a"^i for i in 1:10]) |
| 8 | + @test word_break(tcase1...) && word_break_bfs(tcase1...) |
| 9 | + @test word_break(tcase2...) && word_break_bfs(tcase2...) |
| 10 | + @test word_break(tcase3...) && word_break_bfs(tcase3...) |
| 11 | + @test !word_break(fcase1...) && !word_break_bfs(fcase1...) |
| 12 | + @test !word_break(fcase2...) && !word_break_bfs(fcase2...) |
| 13 | + @test !word_break(fcase3...) && !word_break_bfs(fcase3...) |
8 | 14 | end
|
0 commit comments