class Solution {public: vector<int> findSubstring(string s, vector<string>& words) { if (s.empty() || words.empty()) return {}; vector<int>...
// Time complexity O(n*n)class Solution {public: string longestPalindrome(string s) { int startIdx = 0, left = 0, right = 0, len = 0; for ...
class Solution {public: int lengthOfLongestSubstring(string s) { int m[256] = {0}, res = 0, left = 0; for (int i = 0; i < s.size(); ++i) {...