add: 221025
This commit is contained in:
parent
a6dc9ecaec
commit
9b74100684
|
|
@ -0,0 +1,18 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
#include <numeric>
|
||||
|
||||
/**
|
||||
* 1662. Check If Two String Arrays are Equivalent
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
class Solution {
|
||||
public:
|
||||
static bool arrayStringsAreEqual(const std::vector<std::string>& s, const std::vector<std::string>& t) {
|
||||
return std::accumulate(s.begin(), s.end(), std::string()) == std::accumulate(t.begin(), t.end(), std::string());
|
||||
}
|
||||
};
|
||||
|
|
@ -3,4 +3,4 @@ PROJECT(2210)
|
|||
|
||||
SET(CMAKE_CXX_STANDARD 23)
|
||||
|
||||
ADD_EXECUTABLE(2210 221024.cpp)
|
||||
ADD_EXECUTABLE(2210 221025.cpp)
|
||||
|
|
|
|||
Loading…
Reference in New Issue