Repository navigation
Add Solution and Readme.md for 30[Java] - #62
Merged
Merged
Conversation
yanglbme
reviewed
Oct 26, 2018
| words = ["word","good","good"] | ||
| (ps:原题的例子为 words = ["word","student"] 和题目描述不符,这里私自改了一下) | ||
| 输出: [] | ||
| ``` |
Member
There was a problem hiding this comment.
😁一点小建议噢,代码块的添加与 LeetCode 保持一致:示例字体加粗,输入输出用代码块包围。
e.g.
示例 1:
输入:
s = "barfoothefoobarman",
words = ["foo","bar"]
输出: [0,9]
解释: 从索引 0 和 9 开始的子串分别是 "barfoor" 和 "foobar" 。
输出的顺序不重要, [9,0] 也是有效答案。
示例 2:
输入:
s = "wordgoodstudentgoodword",
words = ["word","student"]
输出: []
| if(s.length() == 0 || words[0].length() == 0 || s.length() < words.length * words[0].length()) { | ||
| return re; | ||
| } | ||
| // 用< 单词,出现次数 > 来存储 words 中的元素,方便查找 |
| if(map.containsKey(tempStr)) { | ||
| HashMap<String,Integer> searched = new HashMap<>(); | ||
| // 从后向前依次对比 | ||
| int tempIndex = j + lastStart; |
Member
There was a problem hiding this comment.
这里缩进得有点多噢~是不是贴过来的时候乱了(⊙o⊙)?
后面代码注释也有缩进的问题。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Correct my error in Readme.md for 029, and Add Solution and Readme.md for 30[Java]