Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4b2f693

Browse files
refactor 1160
1 parent35c6379 commit4b2f693

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

‎src/main/java/com/fishercoder/solutions/_1160.java

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,6 @@
33
importjava.util.HashMap;
44
importjava.util.Map;
55

6-
/**
7-
* 1160. Find Words That Can Be Formed by Characters
8-
*
9-
* You are given an array of strings words and a string chars.
10-
* A string is good if it can be formed by characters from chars (each character can only be used once).
11-
* Return the sum of lengths of all good strings in words.
12-
*
13-
* Example 1:
14-
*
15-
* Input: words = ["cat","bt","hat","tree"], chars = "atach"
16-
* Output: 6
17-
* Explanation:
18-
* The strings that can be formed are "cat" and "hat" so the answer is 3 + 3 = 6.
19-
*
20-
* Example 2:
21-
*
22-
* Input: words = ["hello","world","leetcode"], chars = "welldonehoneyr"
23-
* Output: 10
24-
* Explanation:
25-
* The strings that can be formed are "hello" and "world" so the answer is 5 + 5 = 10.
26-
*
27-
* Note:
28-
*
29-
* 1 <= words.length <= 1000
30-
* 1 <= words[i].length, chars.length <= 100
31-
* All strings contain lowercase English letters only.
32-
* */
336
publicclass_1160 {
347
publicstaticclassSolution1 {
358
publicintcountCharacters(String[]words,Stringchars) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp