Longest substrings without repeating characters: Difference between revisions
Longest substrings without repeating characters (view source)
Revision as of 11:15, 4 June 2021
, 3 years agoSimplified C++ code
(Added C++ solution) |
m (Simplified C++ code) |
||
Line 19:
std::vector<std::string> longest_substrings_without_repeats(const std::string& str) {
size_t max_length = 0;
std::vector<
size_t length = str.size();
for (size_t offset = 0; offset < length; ++offset) {
Line 30:
}
if (len > max_length) {
max_length = len;
}
if (len == max_length)
}
return result;
}
|