def count_subsequences(s1, s2):
m, n = len(s1), len(s2)
dp = [[0] * (n + 1) for _ in range(m + 1)]
for j in range(n + 1):
dp[0][j] = 1
for i in range(1, m + 1):
for j in range(1, n + 1):
if s1[i - 1] == s2[j - 1]:
dp[i][j] = dp[i][j - 1] + dp[i - 1][j - 1]
else:
dp[i][j] = dp[i][j - 1]
return dp[m][n]
Source : Hola โ
m, n = len(s1), len(s2)
dp = [[0] * (n + 1) for _ in range(m + 1)]
for j in range(n + 1):
dp[0][j] = 1
for i in range(1, m + 1):
for j in range(1, n + 1):
if s1[i - 1] == s2[j - 1]:
dp[i][j] = dp[i][j - 1] + dp[i - 1][j - 1]
else:
dp[i][j] = dp[i][j - 1]
return dp[m][n]
Source : Hola โ
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
int countBits(int v) { int count = 0; while (v > 0) { count += v & 1; v >>= 1; } return count; } string palindromeChecker(string s, vector<int> startIndex, vector<int> endIndex, vector<int> subs) { int bp = 0;โฆ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Tech Mahindra is hiring for SERVICE DESK AGENTS
Job Location : Noida (nsez)
-- Should have good and working knowledge on windows/mac os, AD, multifactor authentication, access request of applications.
-- Experience on ITSM TOOLS, remote tools and troubleshooting.
-- Understanding of priority and escalation matrix.
--
Troubleshooting on Application support, printers, mfd's, von software,
collaboration tools, password reset tools, ms windows & office,
desktops, laptops, ipad peripherals & networking etc
-- aware of kpi's and sla's
5 days working
both side cab facility (under 30km of radius from ofc campus)
FRESHERS WITH GOOD COMMUNICATION SKILLS & BASIC TECHNICAL KNOWLEDGE CAN ALSO APPLY.
GRADUATION IS MANDATORY.
ONLY IMMEDIATE JOINERS CAN APPLY.
Call or share your resume @ 8527249359 / ns00834085@techmahindra.com
Job Location : Noida (nsez)
-- Should have good and working knowledge on windows/mac os, AD, multifactor authentication, access request of applications.
-- Experience on ITSM TOOLS, remote tools and troubleshooting.
-- Understanding of priority and escalation matrix.
--
Troubleshooting on Application support, printers, mfd's, von software,
collaboration tools, password reset tools, ms windows & office,
desktops, laptops, ipad peripherals & networking etc
-- aware of kpi's and sla's
5 days working
both side cab facility (under 30km of radius from ofc campus)
FRESHERS WITH GOOD COMMUNICATION SKILLS & BASIC TECHNICAL KNOWLEDGE CAN ALSO APPLY.
GRADUATION IS MANDATORY.
ONLY IMMEDIATE JOINERS CAN APPLY.
Call or share your resume @ 8527249359 / ns00834085@techmahindra.com
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
#include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> pbds; vector<int>โฆ
TTL Cache โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Exciting Internship Opportunity!๐
The Man Company is hiring a Data Analyst Intern!
We are looking for a Data Analyst Intern to join our Operations team. If you have a passion for supply chain management and data analysis, this is the perfect opportunity for you!
๐ Location: Gurgaon (Work from office)
Send CVs at aayushi@themancompany.com
The Man Company is hiring a Data Analyst Intern!
We are looking for a Data Analyst Intern to join our Operations team. If you have a passion for supply chain management and data analysis, this is the perfect opportunity for you!
๐ Location: Gurgaon (Work from office)
Send CVs at aayushi@themancompany.com
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: Kelly (Park+ Startup)
Role: Software Engineer Intern
Batch eligible: 2025 and 2026 grads
Apply: https://docs.google.com/forms/d/e/1FAIpQLSfp9aPne4OyUY3cg7fPsFTdY11NTd1eS_PBDNGn5CiyKaI3kA/viewform
Role: Software Engineer Intern
Batch eligible: 2025 and 2026 grads
Apply: https://docs.google.com/forms/d/e/1FAIpQLSfp9aPne4OyUY3cg7fPsFTdY11NTd1eS_PBDNGn5CiyKaI3kA/viewform
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: Caterpillar
Role: Associate Software Engineer
Batch eligible: 2023 and 2024 grads
Apply: https://careers.caterpillar.com/en/jobs/job/r0000257330-associate-software-engineer/
Role: Associate Software Engineer
Batch eligible: 2023 and 2024 grads
Apply: https://careers.caterpillar.com/en/jobs/job/r0000257330-associate-software-engineer/
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: NI
Role: Software Engineer
Batch eligible: 2023 and 2024 grads
Apply: https://pef.fa.us1.oraclecloud.com/hcmUI/CandidateExperience/en/sites/CX_1/job/9331
Role: Software Engineer
Batch eligible: 2023 and 2024 grads
Apply: https://pef.fa.us1.oraclecloud.com/hcmUI/CandidateExperience/en/sites/CX_1/job/9331
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Awign is hiring for Product Intern
10 k per month stipend
Send resume to : anup.pohaney@awign.com
10 k per month stipend
Send resume to : anup.pohaney@awign.com
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐ Join Our FinTech Team : Founding Mobile Developer
Location: Gurugram
Type: Full-time position at Gurugram Office
Experience: 0-2 yrs of Experience (Freshers/Recent Graduates can also apply) (Flutter Experience Preferred but any mobile development experience will be good enough)
Qualifications: B.Tech CSE Preferred but if you have worked in FinTech earlier, that would be a bigger plus. (Btw Open to all)
Perks: Competitive compensation and ESOPs ; and an exposure to Trading & FinTech Industry like never before.
Apply Here : https://forms.gle/cW1KK2n4hsqzRvdS7
Location: Gurugram
Type: Full-time position at Gurugram Office
Experience: 0-2 yrs of Experience (Freshers/Recent Graduates can also apply) (Flutter Experience Preferred but any mobile development experience will be good enough)
Qualifications: B.Tech CSE Preferred but if you have worked in FinTech earlier, that would be a bigger plus. (Btw Open to all)
Perks: Competitive compensation and ESOPs ; and an exposure to Trading & FinTech Industry like never before.
Apply Here : https://forms.gle/cW1KK2n4hsqzRvdS7
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Check out this job at INDmoney: https://www.linkedin.com/jobs/view/3979166118
Linkedin
INDmoney hiring Product Management Intern in Gurugram, Haryana, India | LinkedIn
Posted 9:44:16 AM. Duration: 6 months
Key ResponsibilitiesAssist with Product Research: Support market research andโฆSee this and similar jobs on LinkedIn.
Key ResponsibilitiesAssist with Product Research: Support market research andโฆSee this and similar jobs on LinkedIn.
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Mouser Electronics is hiring for Web Developer I (0-4 years)
Expected Salary: 10-20 LPA
Apply here:
https://phf.tbe.taleo.net/phf03/ats/careers/v2/viewRequisition?org=MOUSER&cws=40&rid=17859
Expected Salary: 10-20 LPA
Apply here:
https://phf.tbe.taleo.net/phf03/ats/careers/v2/viewRequisition?org=MOUSER&cws=40&rid=17859
phf.tbe.taleo.net
Hiring Web Developer I, Internet MP0600 - BANGALORE INDIA
View job details and apply now
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Scalong AI is hiring for Postgres DBA role
2024/ 2023 batch passouts eligible
Noida location
Send resume at : kajalm@ibosstech-us.com
yashikas@ibosstech-us.com
2024/ 2023 batch passouts eligible
Noida location
Send resume at : kajalm@ibosstech-us.com
yashikas@ibosstech-us.com
int mincost(vector<int> &pods,vector<int> &cost){
map<int,multiset<int>> mp;
for(int i=0;i<pods.size();i++){
mp[pods[i]].insert(cost[i]);
}
int ans = 0;
int curr = (*mp.begin()).first,sm = 0;
multiset<int> se;
while(1){
if(se.size()==0){
if(mp.lower_bound(curr) == mp.end()) break;
curr = (*mp.lower_bound(curr)).first;
}
if(mp.find(curr) != mp.end())
for(auto &x:mp[curr]){
se.insert(x);
sm += x;
}
auto it = se.end();
it--;
sm -= *it;
ans += sm;
se.erase(it);
curr++;
}
return ans;
}
Weird Pod Count โ
map<int,multiset<int>> mp;
for(int i=0;i<pods.size();i++){
mp[pods[i]].insert(cost[i]);
}
int ans = 0;
int curr = (*mp.begin()).first,sm = 0;
multiset<int> se;
while(1){
if(se.size()==0){
if(mp.lower_bound(curr) == mp.end()) break;
curr = (*mp.lower_bound(curr)).first;
}
if(mp.find(curr) != mp.end())
for(auto &x:mp[curr]){
se.insert(x);
sm += x;
}
auto it = se.end();
it--;
sm -= *it;
ans += sm;
se.erase(it);
curr++;
}
return ans;
}
Weird Pod Count โ
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
bool canCoverAllHouses(const vector<int>& houses, int N, int K, int P) {
int count = 0;
int i = 0;
while (i < N && count < K) {
int location = houses[i] + P;
count++;
while (i < N && houses[i] <= location + P) {
i++;
}
}
return i == N;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N, K;
cin >> N >> K;
vector<int> houses(N);
for (int i = 0; i < N; ++i) {
cin >> houses[i];
}
sort(houses.begin(), houses.end());
int left = 0;
int right = houses[N-1] - houses[0];
int result = right;
while (left <= right) {
int mid = left + (right - left) / 2;
if (canCoverAllHouses(houses, N, K, mid)) {
result = mid;
right = mid - 1;
} else {
left = mid + 1;
}
}
cout << result << '\n';
return 0;
}
#include <vector>
#include <algorithm>
using namespace std;
bool canCoverAllHouses(const vector<int>& houses, int N, int K, int P) {
int count = 0;
int i = 0;
while (i < N && count < K) {
int location = houses[i] + P;
count++;
while (i < N && houses[i] <= location + P) {
i++;
}
}
return i == N;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N, K;
cin >> N >> K;
vector<int> houses(N);
for (int i = 0; i < N; ++i) {
cin >> houses[i];
}
sort(houses.begin(), houses.end());
int left = 0;
int right = houses[N-1] - houses[0];
int result = right;
while (left <= right) {
int mid = left + (right - left) / 2;
if (canCoverAllHouses(houses, N, K, mid)) {
result = mid;
right = mid - 1;
} else {
left = mid + 1;
}
}
cout << result << '\n';
return 0;
}
๐1
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
#include <bits/stdc++.h>
#define ll long long
using namespace std;
vector<ll> solve(ll n,ll m,vector<ll>&txt,vector<ll>& pat)
{
vector<ll>mask(UCHAR_MAX+1,~0);
for (ll i=0;i<m;i++)
{
mask[pat[i]]&=~(1U<<i);
}
vector<ll>result;
ll R=~1;
vector<ll>Rm(2,~1);
for (ll i=0;i<n;i++)
{
ll old=R;
R|=mask[txt[i]];
R<<=1;
ll tmp=Rm[1];
Rm[1]=(old&(Rm[1]|mask[txt[i]]))<<1;
old=tmp;
if((Rm[1]&(1U<<m))==0)
{
result.push_back(i-m+2);
}
}
return result;
}
signed main()
{
ll n,m; cin>>n>>m;
vector<ll>txt(n),pat(m);
for(ll i=0;i<n;i++) cin>>txt[i];
for(ll i=0;i<m;i++) cin>>pat[i];
auto ans=solve(n,m,txt,pat);
cout<<ans.size()<<endl;
for(auto it:ans) cout<<it<<" ";
return 0;
}
Phonepe โ
Find my file