Server Selection
JP Morgan โ
JP Morgan โ
โค1
def string_replacement(word, substr):
n = len(word)
m = len(substr)
j = 0
word = list(word)
for i in range(n):
if word[i] == '?':
if j < m:
word[i] = substr[j]
j += 1
else:
return "-1"
if j < m:
return "-1"
return ''.join(word)
String Replacement
Python 3โ
JP Morgan
n = len(word)
m = len(substr)
j = 0
word = list(word)
for i in range(n):
if word[i] == '?':
if j < m:
word[i] = substr[j]
j += 1
else:
return "-1"
if j < m:
return "-1"
return ''.join(word)
String Replacement
Python 3โ
JP Morgan
The Organized Shop
JP Morgan โ
JP Morgan โ
๐1
Meeting Scheduler โ
JP Morgan
JP Morgan
#include<bits/stdc++.h>
using namespace std;
int a[100][100];
int N,K,M;
int getmax(int t,int q,int Z,int Y)
{
int max=0;
for(int i=t;i<Z;i++)
{
for(int j=q;j<Y;j++)
{
if (max<a[i][j])
{
max=a[i][j];
}
}
}
return max;
}
int main()
{
cin>>N>>K>>M;
for(int i=0;i<N;i++)
for(int j=0;j<N;j++)
{
cin>>a[i][j];
}
int i,j;
vector<int>p;
for(int i=0;i<N;i++)
{
for(int j=0;j<N;j++)
{
if((j+K)<=N &&(i+K)<=N)
{
int x =getmax(i,j,i+K,j+K);
p.push_back(x);
}
}
}
vector<int>u;
cout<<"\n\nP array=";
for(int i=0;i<p.size();i++)
{
cout<<p[i]<<" ";
if(p[i]>=M)
{
u.push_back(p[i]);
}
}
cout<<"\n\nOUTPUT:";
cout<<endl<<u.size()<<" "<<*min_element(u.begin(), u.end())<<" "<<*max_element(u.begin(), u.end());
return 0;
}
submatrix maximum
Urban โ
using namespace std;
int a[100][100];
int N,K,M;
int getmax(int t,int q,int Z,int Y)
{
int max=0;
for(int i=t;i<Z;i++)
{
for(int j=q;j<Y;j++)
{
if (max<a[i][j])
{
max=a[i][j];
}
}
}
return max;
}
int main()
{
cin>>N>>K>>M;
for(int i=0;i<N;i++)
for(int j=0;j<N;j++)
{
cin>>a[i][j];
}
int i,j;
vector<int>p;
for(int i=0;i<N;i++)
{
for(int j=0;j<N;j++)
{
if((j+K)<=N &&(i+K)<=N)
{
int x =getmax(i,j,i+K,j+K);
p.push_back(x);
}
}
}
vector<int>u;
cout<<"\n\nP array=";
for(int i=0;i<p.size();i++)
{
cout<<p[i]<<" ";
if(p[i]>=M)
{
u.push_back(p[i]);
}
}
cout<<"\n\nOUTPUT:";
cout<<endl<<u.size()<<" "<<*min_element(u.begin(), u.end())<<" "<<*max_element(u.begin(), u.end());
return 0;
}
submatrix maximum
Urban โ
#include <iostream>
using namespace std;
int main() {
int N;
cin >> N;
int parent[N + 1];
for (int i = 0; i <= N; i++) {
parent[i] = 0;
}
for (int i = 0 ; i < N - 1; i++) {
int u, v;
cin >> u >> v;
parent[v] = u;
}
int Q;
cin >> Q;
for (int i = 0; i < Q; i++) {
int p, c;
cin >> p >> c;
bool found = false;
while (c != 0) {
c = parent[c];
if (c == p) {
found = true;
break;
}
}
if (found) {
cout << "1" << endl;
}
else {
cout << "0" << endl;
}
}
return 0;
}
Tree Relation
Urban โ
using namespace std;
int main() {
int N;
cin >> N;
int parent[N + 1];
for (int i = 0; i <= N; i++) {
parent[i] = 0;
}
for (int i = 0 ; i < N - 1; i++) {
int u, v;
cin >> u >> v;
parent[v] = u;
}
int Q;
cin >> Q;
for (int i = 0; i < Q; i++) {
int p, c;
cin >> p >> c;
bool found = false;
while (c != 0) {
c = parent[c];
if (c == p) {
found = true;
break;
}
}
if (found) {
cout << "1" << endl;
}
else {
cout << "0" << endl;
}
}
return 0;
}
Tree Relation
Urban โ
๐1
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
ll divisors(ll num) {
ll cnt = 0;
for(ll d = 1; d * d <= num; d++) {
if (num % d == 0) {
cnt+=1+(num/d!=d);
// cnt += (num / d == d) ? 1 : 2;
}
}
return cnt;
}
ll numOfSubarrays(vector<ll> &nums) {
ll odd = 0, even = 0, sum = 0;
for (ll num : nums) {
if (divisors(num) & 1) {
swap(odd, even);
++odd;
} else {
++even;
}
sum += odd;
}
return sum;
}
int main() {
int n;
cin >> n;
vector<ll> nums(n);
for (ll &num : nums) cin >> num;
cout << numOfSubarrays(nums);
return 0;
}
Chaotic Subarrays
Urban โ
using namespace std;
using ll = long long;
ll divisors(ll num) {
ll cnt = 0;
for(ll d = 1; d * d <= num; d++) {
if (num % d == 0) {
cnt+=1+(num/d!=d);
// cnt += (num / d == d) ? 1 : 2;
}
}
return cnt;
}
ll numOfSubarrays(vector<ll> &nums) {
ll odd = 0, even = 0, sum = 0;
for (ll num : nums) {
if (divisors(num) & 1) {
swap(odd, even);
++odd;
} else {
++even;
}
sum += odd;
}
return sum;
}
int main() {
int n;
cin >> n;
vector<ll> nums(n);
for (ll &num : nums) cin >> num;
cout << numOfSubarrays(nums);
return 0;
}
Chaotic Subarrays
Urban โ
๐1
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
#include<bits/stdc++.h> using namespace std; int a[100][100]; int N,K,M; int getmax(int t,int q,int Z,int Y) { int max=0; for(int i=t;i<Z;i++) { for(int j=q;j<Y;j++) { if (max<a[i][j]) { โฆ
Submatrix Maximum
Urbanโ
Urbanโ
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
#include<bits/stdc++.h> using namespace std; using ll = long long; ll divisors(ll num) { ll cnt = 0; for(ll d = 1; d * d <= num; d++) { if (num % d == 0) { cnt+=1+(num/d!=d); // cnt += (num / d == d) ? 1 : 2; โฆ
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
ll countSubarray(int N, vector<ll> &A) {
ll odd = 0, even = 0, sum = 0;
for (ll num : A) {
ll sqrtNum = sqrt(num);
if (sqrtNum * sqrtNum == num) {
swap(odd, even);
++odd;
} else {
++even;
}
sum += odd;
}
return sum;
}
int main() {
int n;
cin >> n;
vector<ll> A(n);
for (ll &num : A) cin >> num;
cout << countSubarray(n, A);
return 0;
}.
Chotic subarray โ
Urban
using namespace std;
using ll = long long;
ll countSubarray(int N, vector<ll> &A) {
ll odd = 0, even = 0, sum = 0;
for (ll num : A) {
ll sqrtNum = sqrt(num);
if (sqrtNum * sqrtNum == num) {
swap(odd, even);
++odd;
} else {
++even;
}
sum += odd;
}
return sum;
}
int main() {
int n;
cin >> n;
vector<ll> A(n);
for (ll &num : A) cin >> num;
cout << countSubarray(n, A);
return 0;
}.
Chotic subarray โ
Urban
๐ฑ1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐Zebra Technologies is hiring for Software Engineer, I
Expected Salary: 8-15 LPA
Experience: 0-2 years
๐Apply here: https://zebra.eightfold.ai/careers?src=srm_linkedin_jb&domain=zebra.com&pid=343618832439
Expected Salary: 8-15 LPA
Experience: 0-2 years
๐Apply here: https://zebra.eightfold.ai/careers?src=srm_linkedin_jb&domain=zebra.com&pid=343618832439
zebra.eightfold.ai
Careers at Zebra
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐TechGig Code Gladiators 2024: Unlock your career journey !!
๐ Unlock job and internship opportunities through this coding contest.
- Compete With The Best
- Gain Industry Recognition
- Land Your Dream Job
- Win Big
Win prizes worth Rs 10 Lakhs ๐ฐ and earn the title of Best Coder of the World ๐
๐Apply now at: https://bit.ly/43MyDza
Share this opportunity with your friends ๐.
๐ Unlock job and internship opportunities through this coding contest.
- Compete With The Best
- Gain Industry Recognition
- Land Your Dream Job
- Win Big
Win prizes worth Rs 10 Lakhs ๐ฐ and earn the title of Best Coder of the World ๐
๐Apply now at: https://bit.ly/43MyDza
Share this opportunity with your friends ๐.
Techgig
Code Gladiators - Largest Coding Contest in India | TechGig
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐Sigfyn is hiring for Software Developer (Freshers)
Location: Remote
๐Apply here: https://linkedin.com/jobs/view/3877413684
Location: Remote
๐Apply here: https://linkedin.com/jobs/view/3877413684
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Backend and DevOps Intern for 2023/2024 and 2025 Batch
https://docs.google.com/forms/d/e/1FAIpQLSfRXe7_-7Sscynv2f6oerTFesf0N1byFOolQ8Z2yxmYz1lCTA/viewform
https://docs.google.com/forms/d/e/1FAIpQLSfRXe7_-7Sscynv2f6oerTFesf0N1byFOolQ8Z2yxmYz1lCTA/viewform
โค1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
ZS is Hiring for its Business Technology Solutions Team @ Pune!
Role: Business Technology Solutions Associate (BTSA)
Experience: 0-3 Years
Location: Pune
Notice Period: Immediate joiners only
Qualifications:
- Bachelor's degree in Computer Science or related field
- Skills in ETL technologies (Informatica, Talend, SSIS), data warehousing, and SQL
- Exposure to Cloud Platforms (AWS, Azure, GCP) a plus
Additional Skills:
- Strong communication and problem-solving abilities
- Ability to work in a global team environment
- Willingness to travel as needed
Please send your resume to manish.khatri@zs.com
Role: Business Technology Solutions Associate (BTSA)
Experience: 0-3 Years
Location: Pune
Notice Period: Immediate joiners only
Qualifications:
- Bachelor's degree in Computer Science or related field
- Skills in ETL technologies (Informatica, Talend, SSIS), data warehousing, and SQL
- Exposure to Cloud Platforms (AWS, Azure, GCP) a plus
Additional Skills:
- Strong communication and problem-solving abilities
- Ability to work in a global team environment
- Willingness to travel as needed
Please send your resume to manish.khatri@zs.com
Find the odd one out โ
๐1