Problem URL: [Check if Two String Arrays are Equivalent](https://leetcode.com/problems/check-if-two-string-arrays-are-equivalent/?envType=daily-question&envId=2023-12-01)
Text:
Given two string arrays
A string is represented by an array if the array elements concatenated in order forms the string.
Example 1:
Input:
-
-
Output:
Explanation:
-
-
- The strings are the same, so return
Example 2:
Input:
-
-
Output:
Example 3:
Input:
-
-
Output:
Constraints:
- 1 <=
- 1 <=
- 1 <= sum(
-
Text:
Given two string arrays
word1
and word2
, return true if the two arrays represent the same string, and false otherwise.A string is represented by an array if the array elements concatenated in order forms the string.
Example 1:
Input:
-
word1
= ["ab", "c"]
-
word2
= ["a", "bc"]
Output:
true
Explanation:
-
word1
represents string "ab" + "c" -> "abc"-
word2
represents string "a" + "bc" -> "abc"- The strings are the same, so return
true
.Example 2:
Input:
-
word1
= ["a", "cb"]
-
word2
= ["ab", "c"]
Output:
false
Example 3:
Input:
-
word1
= ["abc", "d", "defg"]
-
word2
= ["abcddefg"]
Output:
true
Constraints:
- 1 <=
word1.length
, word2.length
<= 10^3- 1 <=
word1[i].length
, word2[i].length
<= 10^3- 1 <= sum(
word1[i].length
), sum(word2[i].length
) <= 10^3-
word1[i]
and word2[i]
consist of lowercase letters.Today is a first day of https://adventofcode.com/2023/day/1, great opportunity to learn some new language. I will be solving it in Rust https://github.com/samoylenkodmitry/AdventOfCode_2023
GitHub
GitHub - samoylenkodmitry/AdventOfCode_2023: my advent of code 2023 solutions
my advent of code 2023 solutions. Contribute to samoylenkodmitry/AdventOfCode_2023 development by creating an account on GitHub.
#### Problem
We are given an array of strings
#### Example 1
- Input:
-
-
- Output:
- Explanation: The "good" strings that can be formed are "cat" and "hat", so the answer is
#### Example 2
- Input:
-
-
- Output:
- Explanation: The "good" strings that can be formed are "hello" and "world", so the answer is
#### Constraints
-
-
-
#### Problem URL
[Problem URL](https://leetcode.com/problems/find-words-that-can-be-formed-by-characters/?envType=daily-question&envId=2023-12-02)
We are given an array of strings
words
and a string chars
. A string is considered "good" if it can be formed using characters from chars
, with each character used only once. We need to find the sum of the lengths of all "good" strings in words
.#### Example 1
- Input:
-
words = ["cat","bt","hat","tree"]
-
chars = "atach"
- Output:
6
- Explanation: The "good" strings that can be formed are "cat" and "hat", so the answer is
3 + 3 = 6
.#### Example 2
- Input:
-
words = ["hello","world","leetcode"]
-
chars = "welldonehoneyr"
- Output:
10
- Explanation: The "good" strings that can be formed are "hello" and "world", so the answer is
5 + 5 = 10
.#### Constraints
-
1 <= words.length <= 1000
-
1 <= words[i].length, chars.length <= 100
-
words[i]
and chars
consist of lowercase English letters.#### Problem URL
[Problem URL](https://leetcode.com/problems/find-words-that-can-be-formed-by-characters/?envType=daily-question&envId=2023-12-02)