After many messages like above, I have created new channel where will update job opportunities only for experienced candidates. (It will be difficult to manage 2 channel but will try my best).
Here is the link:
https://t.me/codingsamurai
#KeepSharingwithseniors
Here is the link:
https://t.me/codingsamurai
#KeepSharingwithseniors
Telegram
Experience Jobs & Materials
300+ Placement & Competitive Exam Materials
75+ Companies Materials
10+ Weekly Udemy Course Coupons
Daily Off Campus Jobs Updates
India's Biggest Placement Channel!!
โ๐ดโ๐ดโ๐ฉโ๐ปโ๐โ
๐ Share and Support
Buy ads: https://telega.io/c/codingsamurai
75+ Companies Materials
10+ Weekly Udemy Course Coupons
Daily Off Campus Jobs Updates
India's Biggest Placement Channel!!
โ๐ดโ๐ดโ๐ฉโ๐ปโ๐โ
๐ Share and Support
Buy ads: https://telega.io/c/codingsamurai
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ pinned ยซAfter many messages like above, I have created new channel where will update job opportunities only for experienced candidates. (It will be difficult to manage 2 channel but will try my best). Here is the link: https://t.me/codingsamurai #KeepSharingwithseniorsยป
def check_similar_passwords(new_passwords, old_passwords):
ans = []
for new_pass, old_pass in zip(new_passwords, old_passwords):
i, j = 0, 0
while i < len(new_pass) and j < len(old_pass):
new_char = new_pass[i]
old_char = old_pass[j]
new_shifted_char = 'a' if new_char == 'z' else chr(ord(new_char) + 1)
if old_char == new_char or old_char == new_shifted_char:
j += 1
i += 1
ans.append("YES" if j == len(old_pass) else "NO")
return ans
new_passwords = ["aaccbbee", "aab"]
old_passwords = ["bdbf", "aee"]
print(check_similar_passwords(new_passwords, old_passwords))
Python 3โ
(Amazon)
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: BarRaiser
Role: Backend Intern
Batch eligible: 2024 and 2025 grads
Duration: 6 months
Apply: https://www.linkedin.com/jobs/view/3688872459
Role: Backend Intern
Batch eligible: 2024 and 2025 grads
Duration: 6 months
Apply: https://www.linkedin.com/jobs/view/3688872459
Linkedin
7,000+ Intern jobs in India (301 new)
Todayโs top 7,000+ Intern jobs in India. Leverage your professional network, and get hired. New Intern jobs added daily.
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Zypp Electric Hiring This Position
1. Business Head - Expansion
2. Data/AI/ML Strategy/Product Head
3. Engineering Lead
4. Data Scientist
5. Battery and Motor specialist
https://docs.google.com/forms/d/e/1FAIpQLSfynJaXx3tcjdKsxTOtzzsXaV4Arn397OdQEOU6TjBbCjLYng/viewform
1. Business Head - Expansion
2. Data/AI/ML Strategy/Product Head
3. Engineering Lead
4. Data Scientist
5. Battery and Motor specialist
https://docs.google.com/forms/d/e/1FAIpQLSfynJaXx3tcjdKsxTOtzzsXaV4Arn397OdQEOU6TjBbCjLYng/viewform
#include <bits/stdc++.h>
using namespace std;
int getMaxCount(vector<int>people,vector<char>status){
int i=0;
int ans=0;
map<int,int>mp;
int n=status.size();
for(int i=0;i<n;i++){
int bro=people[i];
if(status[i]=='-'){
mp[bro]--;
if(mp[bro]==0){
mp.erase(bro);
}
}else{
mp[bro]++;
}
int helo=mp.size();
ans=max(ans,helo);
}
return ans;
}
int main() {
int n;
cin>>n;
vector<int>vec(n);
vector<char>vec2(n);
for(int i=0;i<n;i++){
cin>>vec[i];
}
for(int i=0;i<n;i++){
cin>>vec2[i];
}
cout<<getMaxCount(vec,vec2);
return 0;
}
Amazon Dublin โ
using namespace std;
int getMaxCount(vector<int>people,vector<char>status){
int i=0;
int ans=0;
map<int,int>mp;
int n=status.size();
for(int i=0;i<n;i++){
int bro=people[i];
if(status[i]=='-'){
mp[bro]--;
if(mp[bro]==0){
mp.erase(bro);
}
}else{
mp[bro]++;
}
int helo=mp.size();
ans=max(ans,helo);
}
return ans;
}
int main() {
int n;
cin>>n;
vector<int>vec(n);
vector<char>vec2(n);
for(int i=0;i<n;i++){
cin>>vec[i];
}
for(int i=0;i<n;i++){
cin>>vec2[i];
}
cout<<getMaxCount(vec,vec2);
return 0;
}
Amazon Dublin โ
long ans = 0;
for (int i = 0; i < arr.size(); i++)
{
map<int, int> m;
for (int j = i; j < arr.size(); j++)
{
m[arr[j]]++;
}
ans += m.size();
}
return ans;
Amazon Dublin OAโ
for (int i = 0; i < arr.size(); i++)
{
map<int, int> m;
for (int j = i; j < arr.size(); j++)
{
m[arr[j]]++;
}
ans += m.size();
}
return ans;
Amazon Dublin OAโ
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
bool isBalanced(const string& s) {
int balance = 0;
for (char c : s) {
if (c == '[') {
balance++;
} else if (c == ']') {
balance--;
}
}
return balance == 0;
}
string generateRegex(const string& a, const string& b, const string& c) {
int maxLength = a.size() + b.size() + 4; // 4 accounts for potential "[...]" brackets
string longestRegex;
for (int len = maxLength; len >= 0; len--) {
for (int i = 0; i < a.size(); i++) {
for (int j = 0; j < b.size(); j++) {
if (i + len > a.size() || j + len > b.size()) {
continue;
}
string substrA = a.substr(i, len);
string substrB = b.substr(j, len);
if (isBalanced(substrA) && isBalanced(substrB)) {
string regex = "[" + substrA + substrB + "]";
if (regex.find(c) == string::npos && regex.size() > longestRegex.size()) {
longestRegex = regex;
}
}
}
}
}
return longestRegex;
}
int main() {
string a = "DABCIBC";
string b = "ABCA";
string c = "BBCA";
string longestRegex = generateRegex(a, b, c);
cout << longestRegex << endl;
return 0;
}
Amazon Dublin โ
#include <vector>
#include <algorithm>
using namespace std;
bool isBalanced(const string& s) {
int balance = 0;
for (char c : s) {
if (c == '[') {
balance++;
} else if (c == ']') {
balance--;
}
}
return balance == 0;
}
string generateRegex(const string& a, const string& b, const string& c) {
int maxLength = a.size() + b.size() + 4; // 4 accounts for potential "[...]" brackets
string longestRegex;
for (int len = maxLength; len >= 0; len--) {
for (int i = 0; i < a.size(); i++) {
for (int j = 0; j < b.size(); j++) {
if (i + len > a.size() || j + len > b.size()) {
continue;
}
string substrA = a.substr(i, len);
string substrB = b.substr(j, len);
if (isBalanced(substrA) && isBalanced(substrB)) {
string regex = "[" + substrA + substrB + "]";
if (regex.find(c) == string::npos && regex.size() > longestRegex.size()) {
longestRegex = regex;
}
}
}
}
}
return longestRegex;
}
int main() {
string a = "DABCIBC";
string b = "ABCA";
string c = "BBCA";
string longestRegex = generateRegex(a, b, c);
cout << longestRegex << endl;
return 0;
}
Amazon Dublin โ
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
bool isValidMove(int x, int y, const vector<vector<char>>& maze, char forb) {
int rows = maze.size();
int cols = maze[0].size();
return x >= 0 && x < rows && y >= 0 && y < cols && maze[x][y] != forb;
}
int bfs(const vector<vector<char>>& maze, char forb) {
int rows = maze.size();
int cols = maze[0].size();
pair<int, int> start = make_pair(0, 0);
pair<int, int> end = make_pair(rows - 1, cols - 1);
vector<vector<bool>> visited(rows, vector<bool>(cols, false));
deque<tuple<int, int, int>> queue;
queue.push_back(make_tuple(start.first, start.second, 0));
while (!queue.empty()) {
int x, y, length;
tie(x, y, length) = queue.front();
queue.pop_front();
if (make_pair(x, y) == end) {
return length;
}
if (!visited[x][y]) {
visited[x][y] = true;
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
for (int i = 0; i < 4; ++i) {
int new_x = x + dx[i];
int new_y = y + dy[i];
if (isValidMove(new_x, new_y, maze, forb)) {
queue.push_back(make_tuple(new_x, new_y, length + 1));
}
}
}
}
return -1; // No path found
}
The Maze Runner โ
int rows = maze.size();
int cols = maze[0].size();
return x >= 0 && x < rows && y >= 0 && y < cols && maze[x][y] != forb;
}
int bfs(const vector<vector<char>>& maze, char forb) {
int rows = maze.size();
int cols = maze[0].size();
pair<int, int> start = make_pair(0, 0);
pair<int, int> end = make_pair(rows - 1, cols - 1);
vector<vector<bool>> visited(rows, vector<bool>(cols, false));
deque<tuple<int, int, int>> queue;
queue.push_back(make_tuple(start.first, start.second, 0));
while (!queue.empty()) {
int x, y, length;
tie(x, y, length) = queue.front();
queue.pop_front();
if (make_pair(x, y) == end) {
return length;
}
if (!visited[x][y]) {
visited[x][y] = true;
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
for (int i = 0; i < 4; ++i) {
int new_x = x + dx[i];
int new_y = y + dy[i];
if (isValidMove(new_x, new_y, maze, forb)) {
queue.push_back(make_tuple(new_x, new_y, length + 1));
}
}
}
}
return -1; // No path found
}
The Maze Runner โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: Rubrik
Role: Software Engineer Intern
Batch eligible: 2024 grads only
Stipend: 1.5 Lac per month
Apply: https://www.rubrik.com/company/careers/departments/job.5225502.1929
Share with Friends โ๐ป
Role: Software Engineer Intern
Batch eligible: 2024 grads only
Stipend: 1.5 Lac per month
Apply: https://www.rubrik.com/company/careers/departments/job.5225502.1929
Share with Friends โ๐ป
Rubrik
Error
int maximumLearning(vector<int>& articles, vector<int>& iv, int p) {
int n = articles.size();
vector<pair<int, int>> associated;
for (int i = 0; i < n; ++i) {
associated.push_back({2 * articles[i], iv[i]});
}
int maxIntelValue = 0;
for (int mask = 0; mask < (1 << n); ++mask) {
int pagesRead = 0;
int currentValue = 0;
for (int i = 0; i < n; ++i) {
if (mask & (1 << i)) {
if (pagesRead + associated[i].first <= p) {
pagesRead += associated[i].first;
currentValue += associated[i].second;
}
}
}
maxIntelValue = max(maxIntelValue, currentValue);
}
return maxIntelValue;
}
Atlassian โ
int n = articles.size();
vector<pair<int, int>> associated;
for (int i = 0; i < n; ++i) {
associated.push_back({2 * articles[i], iv[i]});
}
int maxIntelValue = 0;
for (int mask = 0; mask < (1 << n); ++mask) {
int pagesRead = 0;
int currentValue = 0;
for (int i = 0; i < n; ++i) {
if (mask & (1 << i)) {
if (pagesRead + associated[i].first <= p) {
pagesRead += associated[i].first;
currentValue += associated[i].second;
}
}
}
maxIntelValue = max(maxIntelValue, currentValue);
}
return maxIntelValue;
}
Atlassian โ
typedef long long ll;
pair<ll, ll> dfs(ll curr, ll prv, const vector<vector<ll>>& adj, const vector<ll>& connect_val, ll k) {
ll tmp = connect_val[curr - 1];
pair<ll, ll> ans = {tmp, tmp};
for (ll x : adj[curr]) {
if (x == prv) continue;
auto tmp = dfs(x, curr, adj, connect_val, k);
ans.second += tmp.second;
ans.first += tmp.first;
}
ans.first = max(ans.first, -k);
return ans;
}
long long get_max_efficiency(ll connect_nodes, const vector<ll>& connect_from, const vector<ll>& connect_to, const vector<ll>& connect_val, ll k) {
ll n = connect_nodes;
vector<vector<ll>> adj(n + 1);
for (ll i = 0; i < connect_from.size(); i++) {
ll u = connect_from[i], v = connect_to[i];
adj[u].push_back(v);
adj[v].push_back(u);
}
return dfs(1, 0, adj, connect_val, k).first;
}
Graph one
Atlassian โ
pair<ll, ll> dfs(ll curr, ll prv, const vector<vector<ll>>& adj, const vector<ll>& connect_val, ll k) {
ll tmp = connect_val[curr - 1];
pair<ll, ll> ans = {tmp, tmp};
for (ll x : adj[curr]) {
if (x == prv) continue;
auto tmp = dfs(x, curr, adj, connect_val, k);
ans.second += tmp.second;
ans.first += tmp.first;
}
ans.first = max(ans.first, -k);
return ans;
}
long long get_max_efficiency(ll connect_nodes, const vector<ll>& connect_from, const vector<ll>& connect_to, const vector<ll>& connect_val, ll k) {
ll n = connect_nodes;
vector<vector<ll>> adj(n + 1);
for (ll i = 0; i < connect_from.size(); i++) {
ll u = connect_from[i], v = connect_to[i];
adj[u].push_back(v);
adj[v].push_back(u);
}
return dfs(1, 0, adj, connect_val, k).first;
}
Graph one
Atlassian โ
ll solve(ll n, ll m, ll k) {
vector<int>a(n, 1);
k--;
ll sum = n, maxjob = 1;
while(sum <= m) {
a[k]++;
maxjob = a[k];
for(ll i = k - 1; i >= 0; i--) {
if(a[i + 1] - a[i] > 1) a[i]++;
}
for(ll i = k + 1; i < n; i++) {
if(a[i - 1] - a[i] > 1) a[i]++;
}
sum = 0;
for(ll i = 0; i < n; i++) sum += a[i];
}
}
Job one
Atlassian โ
vector<int>a(n, 1);
k--;
ll sum = n, maxjob = 1;
while(sum <= m) {
a[k]++;
maxjob = a[k];
for(ll i = k - 1; i >= 0; i--) {
if(a[i + 1] - a[i] > 1) a[i]++;
}
for(ll i = k + 1; i < n; i++) {
if(a[i - 1] - a[i] > 1) a[i]++;
}
sum = 0;
for(ll i = 0; i < n; i++) sum += a[i];
}
}
Job one
Atlassian โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: MasterCard
Role: Software Engineer 1
Batch eligible: 2022 and 2023 grads
Apply: https://careers.mastercard.com/us/en/job/MASRUSR201744EXTERNALENUS/Software-Engineer-I
Role: Software Engineer 1
Batch eligible: 2022 and 2023 grads
Apply: https://careers.mastercard.com/us/en/job/MASRUSR201744EXTERNALENUS/Software-Engineer-I
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
ZS is hiring for DAA
Qualifications:
โข 0-2 years of experience.
โข Bachelor's degree in any engineering discipline, MIS, operations management, or other relevant degree.
โข Proficiency in MS Excel, Python, SQL and regression techniques.
if you interested send ur resume &Referral
varunvj181@gmail.com
Qualifications:
โข 0-2 years of experience.
โข Bachelor's degree in any engineering discipline, MIS, operations management, or other relevant degree.
โข Proficiency in MS Excel, Python, SQL and regression techniques.
if you interested send ur resume &Referral
varunvj181@gmail.com
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
#include <iostream>
#include <vector>
#include <cstring>
using namespace std;
const int MAXN = 105;
const int LOGN = 20;
int n;
vector<int> adj[MAXN];
char label[MAXN];
int parent[MAXN][LOGN];
int depth[MAXN];
int freq[MAXN][26];
void dfs(int node, int par, int d) {
parent[node][0] = par;
depth[node] = d;
for (int i = 1; i < LOGN; ++i) {
if (parent[node][i - 1] != -1) {
parent[node][i] = parent[parent[node][i - 1]][i - 1];
}
}
for (int child : adj[node]) {
if (child != par) {
dfs(child, node, d + 1);
}
}
}
void preprocess() {
memset(parent, -1, sizeof(parent));
dfs(1, -1, 0);
for (int node = 1; node <= n; ++node) {
freq[node][label[node] - 'a']++;
for (int i = 0; i < 26; ++i) {
freq[node][i] += freq[parent[node][0]][i];
}
}
}
int lca(int u, int v) {
if (depth[u] < depth[v]) {
swap(u, v);
}
int diff = depth[u] - depth[v];
for (int i = 0; i < LOGN; ++i) {
if ((diff >> i) & 1) {
u = parent[u][i];
}
}
if (u == v) {
return u;
}
for (int i = LOGN - 1; i >= 0; --i) {
if (parent[u][i] != parent[v][i]) {
u = parent[u][i];
v = parent[v][i];
}
}
return parent[u][0];
}
int main() {
cin >> n;
for (int i = 1; i <= n; ++i) {
cin >> label[i];
}
for (int i = 0; i < n - 1; ++i) {
int u, v;
cin >> u >> v;
adj[u].push_back(v);
adj[v].push_back(u);
}
preprocess();
int q;
cin >> q;
while (q--) {
int u, v;
char c;
cin >> u >> v >> c;
int l = lca(u, v);
int ans = freq[u][c - 'a'] + freq[v][c - 'a'] - 2 * freq[l][c - 'a'] + (label[l] == c);
cout << ans << endl;
}
return 0;
}
Colored Vertex โ
#include <vector>
#include <cstring>
using namespace std;
const int MAXN = 105;
const int LOGN = 20;
int n;
vector<int> adj[MAXN];
char label[MAXN];
int parent[MAXN][LOGN];
int depth[MAXN];
int freq[MAXN][26];
void dfs(int node, int par, int d) {
parent[node][0] = par;
depth[node] = d;
for (int i = 1; i < LOGN; ++i) {
if (parent[node][i - 1] != -1) {
parent[node][i] = parent[parent[node][i - 1]][i - 1];
}
}
for (int child : adj[node]) {
if (child != par) {
dfs(child, node, d + 1);
}
}
}
void preprocess() {
memset(parent, -1, sizeof(parent));
dfs(1, -1, 0);
for (int node = 1; node <= n; ++node) {
freq[node][label[node] - 'a']++;
for (int i = 0; i < 26; ++i) {
freq[node][i] += freq[parent[node][0]][i];
}
}
}
int lca(int u, int v) {
if (depth[u] < depth[v]) {
swap(u, v);
}
int diff = depth[u] - depth[v];
for (int i = 0; i < LOGN; ++i) {
if ((diff >> i) & 1) {
u = parent[u][i];
}
}
if (u == v) {
return u;
}
for (int i = LOGN - 1; i >= 0; --i) {
if (parent[u][i] != parent[v][i]) {
u = parent[u][i];
v = parent[v][i];
}
}
return parent[u][0];
}
int main() {
cin >> n;
for (int i = 1; i <= n; ++i) {
cin >> label[i];
}
for (int i = 0; i < n - 1; ++i) {
int u, v;
cin >> u >> v;
adj[u].push_back(v);
adj[v].push_back(u);
}
preprocess();
int q;
cin >> q;
while (q--) {
int u, v;
char c;
cin >> u >> v >> c;
int l = lca(u, v);
int ans = freq[u][c - 'a'] + freq[v][c - 'a'] - 2 * freq[l][c - 'a'] + (label[l] == c);
cout << ans << endl;
}
return 0;
}
Colored Vertex โ