Codeforces|Leetcode|Codechef free solutions
Open in Telegram
Free codeforces, Codechef, Leetcode solutions are available 😍😍😍😍😍😍 Helped More than 200+ students to crack coding round in 2022 and helped placed them in Good companies. 🥳🥳🥳🤩🤩🤩 Dm @Cpsoln if you want help in coding round.
Show more4 317
Subscribers
No data24 hours
-137 days
-5230 days
Posts Archive
Oracle oa all test cases passed Dm @Cpsoln to book slot for coding rounds
Repost from Codeforces|Leetcode|Codechef free solutions
Company name - Siemens
Role : Software Engineer - C++
Salary - 8-15 LPA
Due - 17 July
Batch - 2022,2023,2024
Location- Chennai
Link : https://shorturl.at/bkKNQ
Repost from Codeforces|Leetcode|Codechef free solutions
Since your placement and intern session is coming 🤓🤓
So don't miss any opportunity in this recession😇😇😇😇
📌📌📌📌📌📌📌📌📌📌📌📌
No scam No fraud because we are not like other telegram channels.
If you want help in coding round of any company then Dm @Cpsoln and book your slot ✅✅✅✅
Company name - Siemens
Role : Software Engineer - C++
Salary - 8-15 LPA
Due - 17 July
Batch - 2022,2023,2024
Location- Chennai
Link : https://shorturl.at/bkKNQ
class Solution { public:
int longestValidSubstring(string word, vector&
forbidden) {
int n = word.length();
vector n) continue;
for (int i = len -1; i < n; i++) { if (i >= len && word.substr(i-len + 1, len) == s && dp[i-
len]) (
dp[i]= false;
}
}
}
for (int i = 0; i < n; i++) {
if (dp[i]) { longestValid - max(longestValid, i+1)
}
}
return longestValid;
}
class Solution {
public:
int longestValidSubstring(string word, vector& forbidden) {
int n = word.length();
vector dp(n, true);
int longestValid = 0;
for (const string& s : forbidden) {
int len = s.length();
if (len > n) continue;
for (int i = len - 1; i < n; i++) {
if (i >= len && word.substr(i - len + 1, len) == s && dp[i - len]) {
dp[i] = false;
}
}
}
for (int i = 0; i < n; i++) {
if (dp[i]) {
longestValid = max(longestValid, i + 1);
}
}
return longestValid;
}
};
