string changeCase(string s, int n)
{
int n = s.size();
string ans = "";
if (n == 1)
{
for (int i = 0; i < n; i++)
{
int a = 0;
if (s[i] == ' ')
a = 1;
else if (a == 1)
ans += toupper(s[i]);
else
ans += s[i];
}
}
else if (n == 2)
{
for (int i = 0; i < n; i++)
{
int a = 0;
if (s[i] == ' ')
ans += '-';
else
ans += s[i];
}
}
else if (n == 3)
{
for (int i = 0; i < n; i++)
{
int a = 0;
if (s[i] == ' ')
ans += '_';
else
ans += s[i];
}
}
else if (n == 4)
{
ans += toupper(s[0]);
for (int i = 1; i < n; i++)
{
int a = 0;
if (s[i] == ' ')
a = 1;
else if (a == 1)
ans += toupper(s[i]);
else
ans += s[i];
}
}
return ans;
}
Case Styling
IBM C++โ
{
int n = s.size();
string ans = "";
if (n == 1)
{
for (int i = 0; i < n; i++)
{
int a = 0;
if (s[i] == ' ')
a = 1;
else if (a == 1)
ans += toupper(s[i]);
else
ans += s[i];
}
}
else if (n == 2)
{
for (int i = 0; i < n; i++)
{
int a = 0;
if (s[i] == ' ')
ans += '-';
else
ans += s[i];
}
}
else if (n == 3)
{
for (int i = 0; i < n; i++)
{
int a = 0;
if (s[i] == ' ')
ans += '_';
else
ans += s[i];
}
}
else if (n == 4)
{
ans += toupper(s[0]);
for (int i = 1; i < n; i++)
{
int a = 0;
if (s[i] == ' ')
a = 1;
else if (a == 1)
ans += toupper(s[i]);
else
ans += s[i];
}
}
return ans;
}
Case Styling
IBM C++โ
๐1
PayPal is hiring Software Engineer!
Qualifications: B.E/ B.Tech/ ME/ M.Tech
Salary: Upto 12 LPA (Expected)
Batch: 2018/ 19/ 20/ 21/ 22/ 23
Location: Bangalore (Remote)
๐Apply Link: https://wd1.myworkdaysite.com/recruiting/paypal/jobs/job/Bangalore-Karnataka-India/MTS-1---Software-Engineer_R0098834
Qualifications: B.E/ B.Tech/ ME/ M.Tech
Salary: Upto 12 LPA (Expected)
Batch: 2018/ 19/ 20/ 21/ 22/ 23
Location: Bangalore (Remote)
๐Apply Link: https://wd1.myworkdaysite.com/recruiting/paypal/jobs/job/Bangalore-Karnataka-India/MTS-1---Software-Engineer_R0098834
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Navi Technologies is hiring across several roles from fresher's to experienced candidates.
Apply: https://docs.google.com/forms/d/e/1FAIpQLScrlKmeX8jn90TwPqcHH47UoU44r88iy5vnEC_LTuZz5iL3xg/viewform
Apply: https://docs.google.com/forms/d/e/1FAIpQLScrlKmeX8jn90TwPqcHH47UoU44r88iy5vnEC_LTuZz5iL3xg/viewform
int findMaxmumGreyness(vector<string> grid)
{
int n = grid.size();
int m = grid[0].length();
vector<int> one_row(n, 0);
vector<int> one_col(m, 0);
for (int i = 0; i < n; i++)
{
for (int j = 0; j < m; j++)
{
if (grid[i][j] == '1')
{
one_row[i]++;
one_col[j]++;
}
}
}
int ans = -1e9;
for (int i = 0; i < n; i++)
{
for (int j = 0; j < m; j++)
{
int ans2 = one_row[i] + one_col[j] - (n + m - one_row[i] - one_col[j]);
ans = max(ans, ans2);
}
}
return ans;
}
Amazon SDE1
C++โ
{
int n = grid.size();
int m = grid[0].length();
vector<int> one_row(n, 0);
vector<int> one_col(m, 0);
for (int i = 0; i < n; i++)
{
for (int j = 0; j < m; j++)
{
if (grid[i][j] == '1')
{
one_row[i]++;
one_col[j]++;
}
}
}
int ans = -1e9;
for (int i = 0; i < n; i++)
{
for (int j = 0; j < m; j++)
{
int ans2 = one_row[i] + one_col[j] - (n + m - one_row[i] - one_col[j]);
ans = max(ans, ans2);
}
}
return ans;
}
Amazon SDE1
C++โ
๐2
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Which of the following type of data structure is used in recursion
Anonymous Quiz
13%
Queues
32%
Array
44%
Stack
11%
List
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Density is hiring for Full Time (From Fresher's to Experienced Candidates)
Apply: https://docs.google.com/forms/d/e/1FAIpQLSfAe17Pmf2k4xcNkD8sMKLZ4DaW_4sV-hr8MMtmL5MM5SeHRA/viewform
Apply: https://docs.google.com/forms/d/e/1FAIpQLSfAe17Pmf2k4xcNkD8sMKLZ4DaW_4sV-hr8MMtmL5MM5SeHRA/viewform
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
ThermoFisher Scientific Software Engineer Intern Hiring (2022 grads eligible)
https://jobs.thermofisher.com/global/en/job/220894BR/Intern-Software-Engineer?rx_ch=jobpost&rx_job=220894BR-1&rx_medium=post&rx_paid=0&rx_r=none&rx_source=linkedin&rx_ts=20230120T123837Z&rx_vp=linkedindirectindex&utm_medium=post&utm_source=recruitics_linkedindirectindex&refId=34jd24&rx_viewer=bdbe6df9884811ed855753bb33aab1cc1610eb2ca1a94c89ab48aea6b33f523e
https://jobs.thermofisher.com/global/en/job/220894BR/Intern-Software-Engineer?rx_ch=jobpost&rx_job=220894BR-1&rx_medium=post&rx_paid=0&rx_r=none&rx_source=linkedin&rx_ts=20230120T123837Z&rx_vp=linkedindirectindex&utm_medium=post&utm_source=recruitics_linkedindirectindex&refId=34jd24&rx_viewer=bdbe6df9884811ed855753bb33aab1cc1610eb2ca1a94c89ab48aea6b33f523e
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Altair Software Development Intern Hiring (2023 grads eligible)
https://phh.tbe.taleo.net/phh01/ats/careers/v2/viewRequisition?org=ALTAENGI&cws=39&rid=42899
https://phh.tbe.taleo.net/phh01/ats/careers/v2/viewRequisition?org=ALTAENGI&cws=39&rid=42899
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Moody's Investor Software Engineer Intern Hiring ( 2022 and 2023 grads can try)
https://careers.moodys.com/job/17645258/software-engineering-intern-gurgaon-in/?codes=LINKEDIN
https://careers.moodys.com/job/17645258/software-engineering-intern-gurgaon-in/?codes=LINKEDIN
Moodys
Software Engineering Intern at Moody's
Apply now to the Software Engineering Intern job opening at Moody's and learn more about the Software Engineering Intern role.
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Paytm is hiring for Android Developer.
Batch eligible: 2021 and 2022 grads.
Location: Noida
Apply Link: https://jobs.lever.co/paytm/a43cdb27-8e9b-4b8e-9ec7-fd47744f8bf4
P.S. If you have knowledge of Android development then only apply.
Batch eligible: 2021 and 2022 grads.
Location: Noida
Apply Link: https://jobs.lever.co/paytm/a43cdb27-8e9b-4b8e-9ec7-fd47744f8bf4
P.S. If you have knowledge of Android development then only apply.
// Infosys
//Given Array A having N integers and divisor K
int morethanNbyK(vector<int> arr, int n, int k)
{
int x = n / k;
int ans = 0;
unordered_map<int, int> freq;
for (auto i : arr)
freq[i]++;
for (auto i : freq)
{
if (i.second > x)
{
ans += i.first;
}
}
return ans;
}
C++โ
//Given Array A having N integers and divisor K
int morethanNbyK(vector<int> arr, int n, int k)
{
int x = n / k;
int ans = 0;
unordered_map<int, int> freq;
for (auto i : arr)
freq[i]++;
for (auto i : freq)
{
if (i.second > x)
{
ans += i.first;
}
}
return ans;
}
C++โ
๐1
// Infosys
// N flowers on a Recatangular pana
int ans = 100000000;
void solve(vector<int> a, int n, int k, int index, int sum,
int maxsum)
{
if (k == 1)
{
maxsum = max(maxsum, sum);
sum = 0;
for (int i = index; i < n; i++)
{
sum += a[i];
}
maxsum = max(maxsum, sum);
ans = min(ans, maxsum);
return;
}
sum = 0;
for (int i = index; i < n; i++)
{
sum += a[i];
maxsum = max(maxsum, sum);
solve(a, n, k - 1, i + 1, sum, maxsum);
}
}
int GetMaxBeauty(int N, int K, vector<int> A)
{
solve(A, N, K, 0, 0, 0);
return ans;
}
infosys-SP-DSP C++โ
// N flowers on a Recatangular pana
int ans = 100000000;
void solve(vector<int> a, int n, int k, int index, int sum,
int maxsum)
{
if (k == 1)
{
maxsum = max(maxsum, sum);
sum = 0;
for (int i = index; i < n; i++)
{
sum += a[i];
}
maxsum = max(maxsum, sum);
ans = min(ans, maxsum);
return;
}
sum = 0;
for (int i = index; i < n; i++)
{
sum += a[i];
maxsum = max(maxsum, sum);
solve(a, n, k - 1, i + 1, sum, maxsum);
}
}
int GetMaxBeauty(int N, int K, vector<int> A)
{
solve(A, N, K, 0, 0, 0);
return ans;
}
infosys-SP-DSP C++โ
๐1
You are given a rooted tree of N vertices and an array A of N integers A[i] is the parent of the vertex (i+1 or 0 if the vertex (i+1) is the root.
For each vertex V from 1 to N, the answer K is the total number of subsets of vertices with the LCA (lowest common ancestor) equal to V Since the of K can be large calculate it modulo 10 ^ 9 + 7
Let there be an integer array Res where Res[i] contains the answer for (I + 1)th vertex, Find the array Res
Notes:
โข The lowest common ancestor (LCA) is defined for X nodes A1, A2,.... Ax as the lowest node in the tree that has all A1 A2..... Ax as descendants (where we allow a node to be a descendant of itself)
Input Formate
The first line contains an integer N denoting the number of elements in A
Each line 1 of the N subsequent lines (where 0<=i<N) contains an integer
describing All It is given that A[i] denotes the parent of the vertex (i+1) or 0
If the vertex (i+1) is the root
const int N = 100005;
const int MOD = 1e9 + 7;
int a[N], dp[N], res[N];
vector<int> g[N];
void dfs(int u) {
dp[u] = 1;
for (int v : g[u]) {
dfs(v);
dp[u] = 1ll * dp[u] * (dp[v] + 1) % MOD;
}
res[u] = (1ll * dp[u] * (1 << g[u].size()) - 1 + MOD) % MOD;
}
vector<int> functionName(int n,vector<int>A)
{
g=A;
dfs(1);
return res;
}
Language c++โ
Infosys
For each vertex V from 1 to N, the answer K is the total number of subsets of vertices with the LCA (lowest common ancestor) equal to V Since the of K can be large calculate it modulo 10 ^ 9 + 7
Let there be an integer array Res where Res[i] contains the answer for (I + 1)th vertex, Find the array Res
Notes:
โข The lowest common ancestor (LCA) is defined for X nodes A1, A2,.... Ax as the lowest node in the tree that has all A1 A2..... Ax as descendants (where we allow a node to be a descendant of itself)
Input Formate
The first line contains an integer N denoting the number of elements in A
Each line 1 of the N subsequent lines (where 0<=i<N) contains an integer
describing All It is given that A[i] denotes the parent of the vertex (i+1) or 0
If the vertex (i+1) is the root
const int N = 100005;
const int MOD = 1e9 + 7;
int a[N], dp[N], res[N];
vector<int> g[N];
void dfs(int u) {
dp[u] = 1;
for (int v : g[u]) {
dfs(v);
dp[u] = 1ll * dp[u] * (dp[v] + 1) % MOD;
}
res[u] = (1ll * dp[u] * (1 << g[u].size()) - 1 + MOD) % MOD;
}
vector<int> functionName(int n,vector<int>A)
{
g=A;
dfs(1);
return res;
}
Language c++โ
Infosys
๐4
You are given Q queries, Each query contains a number N=Quer[i] denoting the ith query.
You have to find M such that:
1 <= M <= N
M|M+1|....| N is as maximum as possible where | is the OR bitwise operation.
M is as maximum as possible.
The answer to this query is the value of M.
Find the sum of answers to all queries modulo 109+7
Note:
A bitwise OR is a binary operation that takes two-bit patterns of equal length and performs the logical inclusive OR operation on each pair of corresponding bits. The result in each position is 0 if both bits are 0, while otherwise, the result is 1.
For example, 0101 (decimal 5) OR 0011 (decimal 3) =0111(decimal 7 )
Input formate:
The first line contains an integer, Q, denoting the number of elements in quer
Each line i of the Q subsequent lines (where 0 <= 1 < Q ) contains an integer describing Quer[i]
const int mod = 1e9 + 7;
int f(int N) {
return (1 << (bitset<32>(N).count() - 1)) - 1;
}
int solve(int Q,vector<int>Quer)
{
int ans = 0;
for(int i=0;i<Q;i++)
ans += f(Quer[i]);
ans %= mod;
}
return ans;
}
Language c++โ
Infosys
You have to find M such that:
1 <= M <= N
M|M+1|....| N is as maximum as possible where | is the OR bitwise operation.
M is as maximum as possible.
The answer to this query is the value of M.
Find the sum of answers to all queries modulo 109+7
Note:
A bitwise OR is a binary operation that takes two-bit patterns of equal length and performs the logical inclusive OR operation on each pair of corresponding bits. The result in each position is 0 if both bits are 0, while otherwise, the result is 1.
For example, 0101 (decimal 5) OR 0011 (decimal 3) =0111(decimal 7 )
Input formate:
The first line contains an integer, Q, denoting the number of elements in quer
Each line i of the Q subsequent lines (where 0 <= 1 < Q ) contains an integer describing Quer[i]
const int mod = 1e9 + 7;
int f(int N) {
return (1 << (bitset<32>(N).count() - 1)) - 1;
}
int solve(int Q,vector<int>Quer)
{
int ans = 0;
for(int i=0;i<Q;i++)
ans += f(Quer[i]);
ans %= mod;
}
return ans;
}
Language c++โ
Infosys
given an array A of size N.
You are allowed to choose at most one pair of elements such that distance (defined as the difference of their indices) is at most K and swap them.
Find the smallest lexicographical array possible after
Notes:
An array x is lexicographically smaller than an array y if there exists an index i such that xi <y i1 and x_{j} = y_{j} for all 0 <= j < i . Less formally, at the first index i in which they differ xi < yi
Input Formats@gman
The First-line contains Integers N Ea an integer, N, denoting the line i of the N subsequent lines (where describing A[i]. of elements in A. N) contains an integer
The next line contains an integer, K, denoting the upper bound on distance of index.
Constraints
Here as all the array values are equal swapping will not change the final result,
Here A=[5,4,3,2,11 K we can swap elements at index 0 and index 3 which makes A= [2,4,3,5,1].
Here A=[2,1,1,1,1] K we can swap elements at index 0 and index 3 chat which makes A= [1.1.1.2.11
bool swapped = false;
for (int i = 0; i < N - 1; i++) {
for (int j = i + 1; j <= min(i + K, N - 1); j++) {
if (A[i] > A[j]) {
swap(A[i], A[j]);
swapped = true;
break;
}
}
if (swapped) break;
}
if (!swapped) return A;
else return A;
C++โ
Infosys
You are allowed to choose at most one pair of elements such that distance (defined as the difference of their indices) is at most K and swap them.
Find the smallest lexicographical array possible after
Notes:
An array x is lexicographically smaller than an array y if there exists an index i such that xi <y i1 and x_{j} = y_{j} for all 0 <= j < i . Less formally, at the first index i in which they differ xi < yi
Input Formats@gman
The First-line contains Integers N Ea an integer, N, denoting the line i of the N subsequent lines (where describing A[i]. of elements in A. N) contains an integer
The next line contains an integer, K, denoting the upper bound on distance of index.
Constraints
Here as all the array values are equal swapping will not change the final result,
Here A=[5,4,3,2,11 K we can swap elements at index 0 and index 3 which makes A= [2,4,3,5,1].
Here A=[2,1,1,1,1] K we can swap elements at index 0 and index 3 chat which makes A= [1.1.1.2.11
bool swapped = false;
for (int i = 0; i < N - 1; i++) {
for (int j = i + 1; j <= min(i + K, N - 1); j++) {
if (A[i] > A[j]) {
swap(A[i], A[j]);
swapped = true;
break;
}
}
if (swapped) break;
}
if (!swapped) return A;
else return A;
C++โ
Infosys
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐ด Company:- Clari
Job Role :- Software Engineer- Backend
Experienced Required : - 3 to 5 years
Eligibility : Any Degree Apply
Salary Range :- 15 to 30 LPA+ (Depend upon Experience)
Job Location - Bengaluru
โ๏ธ Apply Link : https://bit.ly/3GSJ2xR
Job Role :- Software Engineer- Backend
Experienced Required : - 3 to 5 years
Eligibility : Any Degree Apply
Salary Range :- 15 to 30 LPA+ (Depend upon Experience)
Job Location - Bengaluru
โ๏ธ Apply Link : https://bit.ly/3GSJ2xR
jobs.lever.co
Clari - Software Engineer- Backend
About the Role As a backend engineer, you'll work to build scalable applications designed to service millions of mobile and web-based information workers. Youโll work closely with product managers, designers, and others in a cross-functional environment onโฆ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
KPMG (2021/2022) Batch
Qualification: MBA
https://ejgk.fa.em2.oraclecloud.com/hcmUI/CandidateExperience/en/sites/CX_1/job/22000AHB/?utm_medium=jobshare
Qualification: MBA
https://ejgk.fa.em2.oraclecloud.com/hcmUI/CandidateExperience/en/sites/CX_1/job/22000AHB/?utm_medium=jobshare
KPMG India
Analyst
#KI Hiring MBA HR Freshers(21-22 batch only) to be a part of our Talent Acquisition Team. Are you aspiring to start an exciting career in Talent Acquisition? Come & Join our amazing TA team. Job Location : Mumbai, Bangalore, Gurgaon & Pune locations.
๐1