File tree 2 files changed +22
-0
lines changed
2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 299
299
1009|[ Complement of Base 10 Integer] ( ./1009-complement-of-base-10-integer.js ) |Easy|
300
300
1010|[ Pairs of Songs With Total Durations Divisible by 60] ( ./1010-pairs-of-songs-with-total-durations-divisible-by-60.js ) |Medium|
301
301
1022|[ Sum of Root To Leaf Binary Numbers] ( ./1022-sum-of-root-to-leaf-binary-numbers.js ) |Easy|
302
+ 1023|[ Camelcase Matching] ( ./1023-camelcase-matching.js ) |Medium|
302
303
1037|[ Valid Boomerang] ( ./1037-valid-boomerang.js ) |Easy|
303
304
1041|[ Robot Bounded In Circle] ( ./1041-robot-bounded-in-circle.js ) |Medium|
304
305
1047|[ Remove All Adjacent Duplicates In String] ( ./1047-remove-all-adjacent-duplicates-in-string.js ) |Easy|
Original file line number Diff line number Diff line change
1
+ /**
2
+ * 1023. Camelcase Matching
3
+ * https://leetcode.com/problems/camelcase-matching/
4
+ * Difficulty: Medium
5
+ *
6
+ * Given an array of strings queries and a string pattern, return a boolean array answer
7
+ * where answer[i] is true if queries[i] matches pattern, and false otherwise.
8
+ *
9
+ * A query word queries[i] matches pattern if you can insert lowercase English letters
10
+ * pattern so that it equals the query. You may insert each character at any position
11
+ * and you may not insert any characters.
12
+ */
13
+
14
+ /**
15
+ * @param {string[] } queries
16
+ * @param {string } pattern
17
+ * @return {boolean[] }
18
+ */
19
+ var camelMatch = function ( queries , pattern ) {
20
+ return queries . map ( s => s . match ( pattern . split ( / ( .) / ) . join ( '[a-z]*' ) ) ?. at ( 0 ) === s ) ;
21
+ } ;
You can’t perform that action at this time.
0 commit comments