Skip to content

Commit

Permalink
Update 0383.赎金信.md
Browse files Browse the repository at this point in the history
为 Java 语言版本的代码添加长度判断
  • Loading branch information
Winson-Huang authored Apr 18, 2023
1 parent b7ea55c commit 7475636
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions problems/0383.赎金信.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ Java:
```Java
class Solution {
public boolean canConstruct(String ransomNote, String magazine) {
// shortcut
if (ransomNote.length() > magazine.length()) {
return false;
}
// 定义一个哈希映射数组
int[] record = new int[26];

Expand Down

0 comments on commit 7475636

Please sign in to comment.