#include <iostream>
using namespace std;
const int MOD = 1e9 + 7;
long long binomialCoefficient(int n, int k) {
if (k > n - k) {
k = n - k;
}
long long res = 1;
for (int i = 0; i < k; ++i) {
res = (res * (n - i)) % MOD;
res /= (i + 1);
}
return res % MOD;
}
int countDistinctSequences(int x, int y) {
return binomialCoefficient(y - 1, x - 1);
}
int main() {
int x, y;
cin >> x >> y;
int result = countDistinctSequences(x, y);
cout << result << endl;
return 0;
}
Hacks on Amazon โ
using namespace std;
const int MOD = 1e9 + 7;
long long binomialCoefficient(int n, int k) {
if (k > n - k) {
k = n - k;
}
long long res = 1;
for (int i = 0; i < k; ++i) {
res = (res * (n - i)) % MOD;
res /= (i + 1);
}
return res % MOD;
}
int countDistinctSequences(int x, int y) {
return binomialCoefficient(y - 1, x - 1);
}
int main() {
int x, y;
cin >> x >> y;
int result = countDistinctSequences(x, y);
cout << result << endl;
return 0;
}
Hacks on Amazon โ
๐2
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
string lexicographicallySmallest(string P, string Q) {
int N = P.size();
for (int i = 0; i < N; ++i) {
if (P[i] == Q[i]) {
char replacement = 'a';
while (replacement == P[i] || replacement == Q[i]) {
replacement++;
}
P[i] = replacement;
}
}
return P;
}
int main() {
int N;
string P, Q;
cin >> N >> P >> Q;
string result = lexicographicallySmallest(P, Q);
cout << result << endl;
return 0;
}
Hacks on Amazon โ
#include <string>
#include <algorithm>
using namespace std;
string lexicographicallySmallest(string P, string Q) {
int N = P.size();
for (int i = 0; i < N; ++i) {
if (P[i] == Q[i]) {
char replacement = 'a';
while (replacement == P[i] || replacement == Q[i]) {
replacement++;
}
P[i] = replacement;
}
}
return P;
}
int main() {
int N;
string P, Q;
cin >> N >> P >> Q;
string result = lexicographicallySmallest(P, Q);
cout << result << endl;
return 0;
}
Hacks on Amazon โ
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Vance is hiring Backend Engineer
Location - Bangalore
For 2023, 2022, 2021 grads
https://jobs.ashbyhq.com/Vance/0f36d788-0863-412f-a619-5774d0a15fdd/application?utm_source=r9bA27AdXn
Location - Bangalore
For 2023, 2022, 2021 grads
https://jobs.ashbyhq.com/Vance/0f36d788-0863-412f-a619-5774d0a15fdd/application?utm_source=r9bA27AdXn
Ashbyhq
Backend Engineer
๐ Vance seeks Backend Engineers! Innovate in fintech with Java Spring Boot. Bangalore-based role with growth opportunities. #BackendEngineer #Hiring #Fintech
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Castellum Labs is hiring Python Developer Intern
Location - Hyderabad
For 2024 grads
Check out this job at Castellum Labs: https://www.linkedin.com/jobs/view/3936686440
Location - Hyderabad
For 2024 grads
Check out this job at Castellum Labs: https://www.linkedin.com/jobs/view/3936686440
Linkedin
Castellum Labs hiring Python Developer Internship/Trainee in Hyderabad, Telangana, India | LinkedIn
Posted 9:11:01 AM. Company DescriptionCastellum Labs is a next-generation cybersecurity technology venture based inโฆ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)
Kaplan is hiring Associate Software Engineer
For 2023, 2022 grads
https://ghc.wd1.myworkdayjobs.com/Kaplan_Careers/job/Bangalore-KA-India/Associate-Software-Engineer--Hybrid-_JR238196
For 2023, 2022 grads
https://ghc.wd1.myworkdayjobs.com/Kaplan_Careers/job/Bangalore-KA-India/Associate-Software-Engineer--Hybrid-_JR238196
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Deloitte is looking for potential candidates in Risk Consulting Profile
Hiring for Analyst/Senior Analyst positions
Educational Qualifications- Graduate
Work Experience- 0-2 years
Skills-
โขStrong writing skills- Excellent command over written English
โขAbility to work independently with minimal supervision
โขHigh standard of accuracy and eye for detail
โขExcellent time management skill
If interested, kindly share your updated CV with sakshide21@gmail.com with subject as - RA_Analyst/ Senior Analyst
Hiring for Analyst/Senior Analyst positions
Educational Qualifications- Graduate
Work Experience- 0-2 years
Skills-
โขStrong writing skills- Excellent command over written English
โขAbility to work independently with minimal supervision
โขHigh standard of accuracy and eye for detail
โขExcellent time management skill
If interested, kindly share your updated CV with sakshide21@gmail.com with subject as - RA_Analyst/ Senior Analyst
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
SPHERE.IO IS HIRING!!!
https://www.linkedin.com/company/spehre-io/
Contact the HR for further processing
https://www.linkedin.com/in/asmita-santra-238364226?
Or Email the cv at : asmitasantra04@gmail.com
BCOM, M.COM, B.SC,M.SC, BA, MA CAN APPLY
NON IT DOMAIN CANDIDATES
NO B.TECH, M.TECH, BCA, MCA
*ABOUT COMPANY:-*
Spehre is a platform for building a comprehensive professional profile. Its AI rating system evaluates the educational background, work experience, and skillset of users to create a unique rating that reflects their qualifications and capabilities. Recruiters can use Spehre to match job requirements with Spehre-rated candidates, streamlining the hiring process.
*CRITERIA*:-
Under Graduates/ Graduates/ Freshers
*DURATION* :- 2 months (remote internship)
*ON COMPLETION* :-
- Various Certificates
- Performance Based Stipend (up to 10k)
- Letter of Recommendation
- PPO (if you perform well)
https://www.linkedin.com/company/spehre-io/
Contact the HR for further processing
https://www.linkedin.com/in/asmita-santra-238364226?
Or Email the cv at : asmitasantra04@gmail.com
BCOM, M.COM, B.SC,M.SC, BA, MA CAN APPLY
NON IT DOMAIN CANDIDATES
NO B.TECH, M.TECH, BCA, MCA
*ABOUT COMPANY:-*
Spehre is a platform for building a comprehensive professional profile. Its AI rating system evaluates the educational background, work experience, and skillset of users to create a unique rating that reflects their qualifications and capabilities. Recruiters can use Spehre to match job requirements with Spehre-rated candidates, streamlining the hiring process.
*CRITERIA*:-
Under Graduates/ Graduates/ Freshers
*DURATION* :- 2 months (remote internship)
*ON COMPLETION* :-
- Various Certificates
- Performance Based Stipend (up to 10k)
- Letter of Recommendation
- PPO (if you perform well)
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Magically Genius is hiring Backend Developer Intern
Remote opportunity
Check out this job at Magically Genius: https://www.linkedin.com/jobs/view/3936903266
For 2024, 2025, 2026 grads
Remote opportunity
Check out this job at Magically Genius: https://www.linkedin.com/jobs/view/3936903266
For 2024, 2025, 2026 grads
Linkedin
Magically Genius hiring Back End Developer intern in India | LinkedIn
Posted 6:07:00 PM. Role DescriptionThis is a full-time remote role for a back-end developer intern at Magicallyโฆ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)
Infosys is hiring for Chartered Accountants with 0-4 years of post qualification experience for various finance functions.
Job location : Bangalore
If interested share your resume at : Nikhil.shetty04@infosys.com
Job location : Bangalore
If interested share your resume at : Nikhil.shetty04@infosys.com
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main() {
string str;
cin >> str;
vector<int> count(26, 0); // Initialize count for each alphabet letter to 0
for (int i = 0; i < str.size(); i++) {
int index = str[i] - 'a'; // Convert character to corresponding index in count array
cout << str[i] << ":" << count[index] << " ";
cout<<endl;// Output letter and its count
count[index]++; // Increment count for current letter
}
return 0;
}
Hacks on Amazon โ
#include <vector>
#include <string>
using namespace std;
int main() {
string str;
cin >> str;
vector<int> count(26, 0); // Initialize count for each alphabet letter to 0
for (int i = 0; i < str.size(); i++) {
int index = str[i] - 'a'; // Convert character to corresponding index in count array
cout << str[i] << ":" << count[index] << " ";
cout<<endl;// Output letter and its count
count[index]++; // Increment count for current letter
}
return 0;
}
Hacks on Amazon โ
๐2
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Swish Club is hiring Product Management Intern
For 2024 grads
Check out this job at Swish Club: https://www.linkedin.com/jobs/view/3936821216
For 2024 grads
Check out this job at Swish Club: https://www.linkedin.com/jobs/view/3936821216
Linkedin
Swish Club hiring Product Management Intern in Bengaluru, Karnataka, India | LinkedIn
Posted 12:24:02 PM. ๐ Hiring for Product Interns! ๐ About the Companyโ Swish Club is India's first "Employee Savingsโฆ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)
Victoria's Secret and Co is hiring Associate Software Engineer
Location - Bangalore
For 2023, 2022 grads
https://careers.victoriassecret.com/job-2/20193431
Location - Bangalore
For 2023, 2022 grads
https://careers.victoriassecret.com/job-2/20193431
Victoriaโs Secret Careers
Victoriaโs Secret - Job Description
Learn more about this particular Victoriaโs Secret role and others similar to it today.
๐1
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
#include <iostream>
#include <vector>
#include <queue>
#include <unordered_map>
#include <climits>
using namespace std;
vector<int> dijkstra(int start, int end, const vector<vector<int>>& graph, int N) {
vector<int> dist(N + 1, INT_MAX);
dist[start] = 0;
priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> pq;
pq.push({0, start});
while (!pq.empty()) {
int d = pq.top().first;
int u = pq.top().second;
pq.pop();
if (d > dist[u]) continue;
for (int v : graph[u]) {
if (dist[u] + 1 < dist[v]) {
dist[v] = dist[u] + 1;
pq.push({dist[v], v});
}
}
}
return dist;
}
vector<int> solution(const vector<int>& A, const vector<int>& B, int N) {
vector<vector<int>> graph(N + 1);
for (int i = 1; i < N; ++i) {
graph[i].push_back(i + 1);
graph[i + 1].push_back(i);
}
vector<int> initial_dist = dijkstra(1, N, graph, N);
vector<int> results;
for (int i = 0; i < A.size(); ++i) {
graph[A[i]].push_back(B[i]);
graph[B[i]].push_back(A[i]);
vector<int> new_dist = dijkstra(1, N, graph, N);
results.push_back(new_dist[N]);
}
return results;
}
Hashedin โ
#include <vector>
#include <queue>
#include <unordered_map>
#include <climits>
using namespace std;
vector<int> dijkstra(int start, int end, const vector<vector<int>>& graph, int N) {
vector<int> dist(N + 1, INT_MAX);
dist[start] = 0;
priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> pq;
pq.push({0, start});
while (!pq.empty()) {
int d = pq.top().first;
int u = pq.top().second;
pq.pop();
if (d > dist[u]) continue;
for (int v : graph[u]) {
if (dist[u] + 1 < dist[v]) {
dist[v] = dist[u] + 1;
pq.push({dist[v], v});
}
}
}
return dist;
}
vector<int> solution(const vector<int>& A, const vector<int>& B, int N) {
vector<vector<int>> graph(N + 1);
for (int i = 1; i < N; ++i) {
graph[i].push_back(i + 1);
graph[i + 1].push_back(i);
}
vector<int> initial_dist = dijkstra(1, N, graph, N);
vector<int> results;
for (int i = 0; i < A.size(); ++i) {
graph[A[i]].push_back(B[i]);
graph[B[i]].push_back(A[i]);
vector<int> new_dist = dijkstra(1, N, graph, N);
results.push_back(new_dist[N]);
}
return results;
}
Hashedin โ
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
#include <vector>
#include <iostream>
#include <algorithm>
#include <climits>
using namespace std;
int solution(vector<vector<int>>& chessboard) {
int N = chessboard.size();
vector<vector<pair<int, int>>> topTwoMax(N, vector<pair<int, int>>(2, {0, -1}));
for (int i = 0; i < N; ++i) {
int max1 = INT_MIN, max2 = INT_MIN;
int idx1 = -1, idx2 = -1;
for (int j = 0; j < chessboard[i].size(); ++j) {
if (chessboard[i][j] >= max1) {
max2 = max1;
idx2 = idx1;
max1 = chessboard[i][j];
idx1 = j;
} else if (chessboard[i][j] > max2) {
max2 = chessboard[i][j];
idx2 = j;
}
}
topTwoMax[i][0] = {max1, idx1};
topTwoMax[i][1] = {max2, idx2};
}
int maxSum = 0;
for (int i = 0; i < N; ++i) {
for (int j = i + 1; j < N; ++j) {
int sum = topTwoMax[i][0].first + topTwoMax[j][0].first;
if (topTwoMax[i][0].second != topTwoMax[j][0].second) {
maxSum = max(maxSum, sum);
} else {
sum = max(topTwoMax[i][0].first + topTwoMax[j][1].first,
topTwoMax[i][1].first + topTwoMax[j][0].first);
maxSum = max(maxSum, sum);
}
}
}
return maxSum;
}
#include <iostream>
#include <algorithm>
#include <climits>
using namespace std;
int solution(vector<vector<int>>& chessboard) {
int N = chessboard.size();
vector<vector<pair<int, int>>> topTwoMax(N, vector<pair<int, int>>(2, {0, -1}));
for (int i = 0; i < N; ++i) {
int max1 = INT_MIN, max2 = INT_MIN;
int idx1 = -1, idx2 = -1;
for (int j = 0; j < chessboard[i].size(); ++j) {
if (chessboard[i][j] >= max1) {
max2 = max1;
idx2 = idx1;
max1 = chessboard[i][j];
idx1 = j;
} else if (chessboard[i][j] > max2) {
max2 = chessboard[i][j];
idx2 = j;
}
}
topTwoMax[i][0] = {max1, idx1};
topTwoMax[i][1] = {max2, idx2};
}
int maxSum = 0;
for (int i = 0; i < N; ++i) {
for (int j = i + 1; j < N; ++j) {
int sum = topTwoMax[i][0].first + topTwoMax[j][0].first;
if (topTwoMax[i][0].second != topTwoMax[j][0].second) {
maxSum = max(maxSum, sum);
} else {
sum = max(topTwoMax[i][0].first + topTwoMax[j][1].first,
topTwoMax[i][1].first + topTwoMax[j][0].first);
maxSum = max(maxSum, sum);
}
}
}
return maxSum;
}