Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Exciting Opportunity for MBA Grads at EY! ๐
EY is looking to onboard MBA graduates with a passion for Tech-Driven Business Process Improvement! If you meet the following criteria, this could be the opportunity you've been waiting for:
Criteria:
1. MBA from a tier-1 institute (2019, 2020, 2021, and 2022 batches)
2. 2-4 years of experience in management consulting from a tier-1 firm
3. Based out of Mumbai/ Delhi/ Bangalore and willing to travel for case work
4. Strong communication and interpersonal skills
If you fit the bill, don't miss out on this chance! Send your resumes to tathagata.ghosh1@in.ey.com and take the next step in your career with EY! ๐
EY is looking to onboard MBA graduates with a passion for Tech-Driven Business Process Improvement! If you meet the following criteria, this could be the opportunity you've been waiting for:
Criteria:
1. MBA from a tier-1 institute (2019, 2020, 2021, and 2022 batches)
2. 2-4 years of experience in management consulting from a tier-1 firm
3. Based out of Mumbai/ Delhi/ Bangalore and willing to travel for case work
4. Strong communication and interpersonal skills
If you fit the bill, don't miss out on this chance! Send your resumes to tathagata.ghosh1@in.ey.com and take the next step in your career with EY! ๐
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐BrowserStack is Hiring !!
Role: Automation Support Engineer
Batch: 2023
Expected CTC: 8-12 LPA
๐Apply here: https://browserstack.wd3.myworkdayjobs.com/en-US/External/job/India-Remote/Automation-Support-Engineer---2023-Batch-Graduates_JR101015
Role: Automation Support Engineer
Batch: 2023
Expected CTC: 8-12 LPA
๐Apply here: https://browserstack.wd3.myworkdayjobs.com/en-US/External/job/India-Remote/Automation-Support-Engineer---2023-Batch-Graduates_JR101015
Myworkdayjobs
Automation Support Engineer - 2023 Batch Graduates
Who are we and what do we do? BrowserStack is the world's leading software testing platform powering over two million tests every day across 19 global data centers. BrowserStack's products help developers build bug-free software for the 5 billion internetโฆ
#include <bits/stdc++.h>
#define ll long long
using namespace std;
ll solve(ll k, ll s) {
auto comb = [](ll n) {
return n * (n - 1) / 2;
};
if (k > 3 * s) return 0;
ll ans = comb(k + 2);
if (k > s) ans -= 3 * comb(k - s + 1);
if (k - 2 >= 2 * s) ans += 3 * comb(k - 2 * s);
return ans;
}
int main() {
ll n, s;
cin >> n >> s;
cout << solve(s,n) << endl;
return 0;
}
Distribute Car Toy
Service Now โ
#define ll long long
using namespace std;
ll solve(ll k, ll s) {
auto comb = [](ll n) {
return n * (n - 1) / 2;
};
if (k > 3 * s) return 0;
ll ans = comb(k + 2);
if (k > s) ans -= 3 * comb(k - s + 1);
if (k - 2 >= 2 * s) ans += 3 * comb(k - 2 * s);
return ans;
}
int main() {
ll n, s;
cin >> n >> s;
cout << solve(s,n) << endl;
return 0;
}
Distribute Car Toy
Service Now โ
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<vector<int>> freq(n, vector<int> (26, 0));
string s;
for(int i = 0; i < n; i++) {
string s;
cin >> s;
for(auto &ch : s)
freq[i][ch - 'a']++;
}
long long ans = 0;
for(int i = 0; i < 26; i++) {
int minValue = INT_MAX;
for(int j = 0; j < n; j++)
minValue = min(minValue, freq[j][i]);
ans += minValue;
}
cout << ans << endl;
}
Service Now โ
using namespace std;
int main() {
int n;
cin >> n;
vector<vector<int>> freq(n, vector<int> (26, 0));
string s;
for(int i = 0; i < n; i++) {
string s;
cin >> s;
for(auto &ch : s)
freq[i][ch - 'a']++;
}
long long ans = 0;
for(int i = 0; i < 26; i++) {
int minValue = INT_MAX;
for(int j = 0; j < n; j++)
minValue = min(minValue, freq[j][i]);
ans += minValue;
}
cout << ans << endl;
}
Service Now โ
#include<bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> nums(n);
for(int i = 0; i < n; i++) {
cin >> nums[i];
}
nums.erase(unique(nums.begin(), nums.end()), nums.end());
int sum = 0;
for(int i = 0; i < nums.size(); i++) {
sum += pow(2, nums[i]);
}
cout << sum << endl;
return 0;
}
Special sum โ
Service Now
using namespace std;
int main() {
int n;
cin >> n;
vector<int> nums(n);
for(int i = 0; i < n; i++) {
cin >> nums[i];
}
nums.erase(unique(nums.begin(), nums.end()), nums.end());
int sum = 0;
for(int i = 0; i < nums.size(); i++) {
sum += pow(2, nums[i]);
}
cout << sum << endl;
return 0;
}
Special sum โ
Service Now
#include<bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
multiset<int, greater<int>> s;
for(int i = 0; i < N; i++) {
int x;
cin >> x;
s.insert(x);
}
int count = 0;
while(!s.empty()) {
int x = *s.begin();
s.erase(s.begin());
if(s.empty() || *s.begin() != x) {
count++;
if(x / 2 > 0)
s.insert(x / 2);
} else {
s.erase(s.lower_bound(x), s.upper_bound(x));
}
}
cout << count << endl;
return 0;
}
Counting problem โ
Service Now
using namespace std;
int main() {
int N;
cin >> N;
multiset<int, greater<int>> s;
for(int i = 0; i < N; i++) {
int x;
cin >> x;
s.insert(x);
}
int count = 0;
while(!s.empty()) {
int x = *s.begin();
s.erase(s.begin());
if(s.empty() || *s.begin() != x) {
count++;
if(x / 2 > 0)
s.insert(x / 2);
} else {
s.erase(s.lower_bound(x), s.upper_bound(x));
}
}
cout << count << endl;
return 0;
}
Counting problem โ
Service Now
#include<bits/stdc++.h>
using namespace std;
string solve(string s, int k) {
string vowels = "aeiou";
string result = "";
for (char c : s) {
if (vowels.find(c) != string::npos) {
k += 2;
} else {
k += 1;
}
result += to_string(k * int(c)) + " ";
}
return result;
}
int main() {
string s;
int k;
cin >> s >> k;
cout << solve(s, k) << endl;
return 0;
}
Enciphering a String โ
Service Now
using namespace std;
string solve(string s, int k) {
string vowels = "aeiou";
string result = "";
for (char c : s) {
if (vowels.find(c) != string::npos) {
k += 2;
} else {
k += 1;
}
result += to_string(k * int(c)) + " ";
}
return result;
}
int main() {
string s;
int k;
cin >> s >> k;
cout << solve(s, k) << endl;
return 0;
}
Enciphering a String โ
Service Now
#include<bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> arr(n);
for(int i=0; i<n; i++) {
cin >> arr[i];
}
unordered_set<int> s;
vector<int> res(n);
for(int i=n-1; i>=0; i--) {
if(s.find(arr[i]) != s.end()) {
res[i] = 1;
} else {
res[i] = -1;
s.insert(arr[i]);
}
}
for(int i=0; i<n; i++) {
cout << res[i] << " ";
}
cout << endl;
return 0;
}
Elements on the right side โ
Service Now
using namespace std;
int main() {
int n;
cin >> n;
vector<int> arr(n);
for(int i=0; i<n; i++) {
cin >> arr[i];
}
unordered_set<int> s;
vector<int> res(n);
for(int i=n-1; i>=0; i--) {
if(s.find(arr[i]) != s.end()) {
res[i] = 1;
} else {
res[i] = -1;
s.insert(arr[i]);
}
}
for(int i=0; i<n; i++) {
cout << res[i] << " ";
}
cout << endl;
return 0;
}
Elements on the right side โ
Service Now
#include<bits/stdc++.h>
using namespace std;
int solve(vector<int>& A) {
int n = A.size();
if (n <= 2) return n;
vector<unordered_map<int, int>> dp(n);
int res = 2;
for (int i = 1; i < n; ++i) {
for (int j = 0; j < i; ++j) {
int diff = A[i] - A[j];
dp[i][diff] = max(dp[i][diff], dp[j][diff] + 1);
res = max(res, dp[i][diff] + 1);
}
}
return res;
}
int main() {
int n;
cin >> n;
vector<int> A(n);
for(int i = 0; i < n; i++) {
cin >> A[i];
}
cout << solve(A) << endl;
return 0;
}
Consequtive longest ap โ
Service Now
using namespace std;
int solve(vector<int>& A) {
int n = A.size();
if (n <= 2) return n;
vector<unordered_map<int, int>> dp(n);
int res = 2;
for (int i = 1; i < n; ++i) {
for (int j = 0; j < i; ++j) {
int diff = A[i] - A[j];
dp[i][diff] = max(dp[i][diff], dp[j][diff] + 1);
res = max(res, dp[i][diff] + 1);
}
}
return res;
}
int main() {
int n;
cin >> n;
vector<int> A(n);
for(int i = 0; i < n; i++) {
cin >> A[i];
}
cout << solve(A) << endl;
return 0;
}
Consequtive longest ap โ
Service Now
#include<bits/stdc++.h>
using namespace std;
int solve(vector<int>& v) {
int n = v.size();
vector<int> dp(n, INT_MAX);
dp[0] = 0;
for(int i = 0; i < n; i++) {
for(int j = i+1; j <= min(i+3, n-1); j++) {
dp[j] = min(dp[j], dp[i] + abs(v[i] - v[j]));
}
}
return dp[n-1];
}
int main() {
int n;
cin >> n;
vector<int> v(n);
for(int i = 0; i < n; i++) {
cin >> v[i];
}
cout <<solve(v) << endl;
return 0;
}
Three jump โ
Service Now
using namespace std;
int solve(vector<int>& v) {
int n = v.size();
vector<int> dp(n, INT_MAX);
dp[0] = 0;
for(int i = 0; i < n; i++) {
for(int j = i+1; j <= min(i+3, n-1); j++) {
dp[j] = min(dp[j], dp[i] + abs(v[i] - v[j]));
}
}
return dp[n-1];
}
int main() {
int n;
cin >> n;
vector<int> v(n);
for(int i = 0; i < n; i++) {
cin >> v[i];
}
cout <<solve(v) << endl;
return 0;
}
Three jump โ
Service Now
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Diamond Boxes โ
Service Now
bool check(vector<int>&v,int mid,int t){
int trip=0,curr=0;
for(auto it : v){
if(it>mid)return false;
if(curr+it>mid){
trip++;
curr=it;
}
else curr+=it;
}
if(curr>0)trip++;
return trip<=t;
}
void diamondBoxes(){
int n;
cin>>n;
vector<int>v(n);
int l=0,r=0;
for(int i=0;i<n;i++){
cin>>v[i];
l=max(l,v[i]);
r+=v[i];
}
int t;
cin>>t;
while(l<r){
int mid=l+(r-l)/2;
if(check(v,mid,t))r=mid;
else l=mid+1;
}
cout<<l<<endl;
}
Diamond Boxes โ
int trip=0,curr=0;
for(auto it : v){
if(it>mid)return false;
if(curr+it>mid){
trip++;
curr=it;
}
else curr+=it;
}
if(curr>0)trip++;
return trip<=t;
}
void diamondBoxes(){
int n;
cin>>n;
vector<int>v(n);
int l=0,r=0;
for(int i=0;i<n;i++){
cin>>v[i];
l=max(l,v[i]);
r+=v[i];
}
int t;
cin>>t;
while(l<r){
int mid=l+(r-l)/2;
if(check(v,mid,t))r=mid;
else l=mid+1;
}
cout<<l<<endl;
}
Diamond Boxes โ
#include<bits/stdc++.h>
using namespace std;
int main(){
long long i,j,n,m,a,b,cnt;
while(cin>>n)
{
long long f[10000],a[1000];
memset(f,0,sizeof(f));
for(i=0;i<n;i++)
{
cin>>a[i];
f[i]=0;
}
sort(a,a+n);
cnt=0;
for(i=0;i<n;i++){
for(j=i+1;j<n;j++){
if(f[j]==0&&a[i]<a[j])
{
cnt++;
f[j]=1;
break;
}
}
}
cout<<cnt<<endl;
}
return 0;
}
Art โ
Service Now
using namespace std;
int main(){
long long i,j,n,m,a,b,cnt;
while(cin>>n)
{
long long f[10000],a[1000];
memset(f,0,sizeof(f));
for(i=0;i<n;i++)
{
cin>>a[i];
f[i]=0;
}
sort(a,a+n);
cnt=0;
for(i=0;i<n;i++){
for(j=i+1;j<n;j++){
if(f[j]==0&&a[i]<a[j])
{
cnt++;
f[j]=1;
break;
}
}
}
cout<<cnt<<endl;
}
return 0;
}
Art โ
Service Now
#include<bits/stdc++.h>
using namespace std;
int solve(vector<int>& arr, int k) {
int n = arr.size();
sort(arr.begin(), arr.end());
vector<int> dp(n+1, INT_MAX);
dp[0] = 0;
for(int i = 1; i <= n; i++) {
int maxVul = arr[i-1];
for(int j = i-1; j >= max(0, i-k); j--) {
maxVul = max(maxVul, arr[j]);
dp[i] = min(dp[i], dp[j] + maxVul);
}
}
return dp[n];
}
int main() {
int n, k;
cin >> n >> k;
vector<int> arr(n);
for(int i = 0; i < n; i++) {
cin >> arr[i];
}
cout << solve(arr, k) << endl;
return 0;
}
IT departmentโ
using namespace std;
int solve(vector<int>& arr, int k) {
int n = arr.size();
sort(arr.begin(), arr.end());
vector<int> dp(n+1, INT_MAX);
dp[0] = 0;
for(int i = 1; i <= n; i++) {
int maxVul = arr[i-1];
for(int j = i-1; j >= max(0, i-k); j--) {
maxVul = max(maxVul, arr[j]);
dp[i] = min(dp[i], dp[j] + maxVul);
}
}
return dp[n];
}
int main() {
int n, k;
cin >> n >> k;
vector<int> arr(n);
for(int i = 0; i < n; i++) {
cin >> arr[i];
}
cout << solve(arr, k) << endl;
return 0;
}
IT departmentโ
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
int main() {
int n;
cin >> n;
vector<int> powOf2;
long long val = 1;
for(int i = 0; i <= n; i++) {
powOf2.push_back(val);
val = (val * 2) % MOD;
}
long long ans = 0;
for(int i = n - 1; i > 0; i-= 2)
ans = (ans + powOf2[i]) % MOD;
cout << ans << endl;
}
Lucky Strings โ
using namespace std;
#define MOD 1000000007
int main() {
int n;
cin >> n;
vector<int> powOf2;
long long val = 1;
for(int i = 0; i <= n; i++) {
powOf2.push_back(val);
val = (val * 2) % MOD;
}
long long ans = 0;
for(int i = n - 1; i > 0; i-= 2)
ans = (ans + powOf2[i]) % MOD;
cout << ans << endl;
}
Lucky Strings โ
New shelfโ
Service Now
Service Now
public static void main (String[] args) throws java.lang.Exception
{
int tes=1;
StringBuilder sb=new StringBuilder();
lable:for(int fuck=1;fuck<=tes;fuck++)
{
int n=sc.nextInt(),i;
ArrayList<ArrayList<Integer>> arr=new ArrayList<>();
for(i=0;i<=n;i++) arr.add(new ArrayList<>());
for(i=2;i<=n;i++){
int x=sc.nextInt();
arr.get(x).add(i);
arr.get(i).add(x);
}
int dp[]=new int[n+1];
int okk=dfs(1,0,dp,arr);
for(i=1;i<=n;i++) System.out.print(dp[i]+" ");
}
}
public static int dfs(int u,int p,int dp[],ArrayList<ArrayList<Integer>> arr){
for(int it:arr.get(u)){
if(it==p) continue;
dp[u]=dp[u]+dfs(it,u,dp,arr)+1;
}
return dp[u];
}
//Organisation
Service Now โ
{
int tes=1;
StringBuilder sb=new StringBuilder();
lable:for(int fuck=1;fuck<=tes;fuck++)
{
int n=sc.nextInt(),i;
ArrayList<ArrayList<Integer>> arr=new ArrayList<>();
for(i=0;i<=n;i++) arr.add(new ArrayList<>());
for(i=2;i<=n;i++){
int x=sc.nextInt();
arr.get(x).add(i);
arr.get(i).add(x);
}
int dp[]=new int[n+1];
int okk=dfs(1,0,dp,arr);
for(i=1;i<=n;i++) System.out.print(dp[i]+" ");
}
}
public static int dfs(int u,int p,int dp[],ArrayList<ArrayList<Integer>> arr){
for(int it:arr.get(u)){
if(it==p) continue;
dp[u]=dp[u]+dfs(it,u,dp,arr)+1;
}
return dp[u];
}
//Organisation
Service Now โ
#include<bits/stdc++.h>
using namespace std;
vector<int> solve(int V, vector<int>& bosses) {
vector<int> h(V, 0);
for(int i = 0; i < V-1; i++) {
int b = bosses[i];
while(b != -1) {
h[b-1]++;
b = (b-1 > 0 ? bosses[b-2] : -1);
}
}
return h;
}
int main() {
int V;
cin >> V;
vector<int> b(V-1);
for(int i = 0; i < V-1; i++) {
cin >> b[i];
}
vector<int> h = solve(V, b);
for(int i = 0; i < V; i++) {
cout << h[i] << " ";
}
cout << endl;
return 0;
}
Find Hierarchyโ
using namespace std;
vector<int> solve(int V, vector<int>& bosses) {
vector<int> h(V, 0);
for(int i = 0; i < V-1; i++) {
int b = bosses[i];
while(b != -1) {
h[b-1]++;
b = (b-1 > 0 ? bosses[b-2] : -1);
}
}
return h;
}
int main() {
int V;
cin >> V;
vector<int> b(V-1);
for(int i = 0; i < V-1; i++) {
cin >> b[i];
}
vector<int> h = solve(V, b);
for(int i = 0; i < V; i++) {
cout << h[i] << " ";
}
cout << endl;
return 0;
}
Find Hierarchyโ
#include <bits/stdc++.h>
using namespace std;
void twiceIsEnough(string &s){
int n=s.length();
int i=0,j=0,ans=0;
unordered_map<char,int>mp;
while(i<n){
while(j<i && mp[s[i]]==2){
mp[s[j]]--;
if(mp[s[j]]==0)mp.erase(s[j]);
j++;
}
mp[s[i]]++;
ans=max(ans,i-j+1);
i++;
}
cout<<ans<<endl;
}
int main(){
string s;
cin>>s;
twiceIsEnough(s);
}
first non repeating and twice is enoughโ
using namespace std;
void twiceIsEnough(string &s){
int n=s.length();
int i=0,j=0,ans=0;
unordered_map<char,int>mp;
while(i<n){
while(j<i && mp[s[i]]==2){
mp[s[j]]--;
if(mp[s[j]]==0)mp.erase(s[j]);
j++;
}
mp[s[i]]++;
ans=max(ans,i-j+1);
i++;
}
cout<<ans<<endl;
}
int main(){
string s;
cin>>s;
twiceIsEnough(s);
}
first non repeating and twice is enoughโ
int a,b,c;
cin>>a>>b>>c;
int d=a&b;
int ans=0;
for(int i=0;i<32;i++)
{
if((c&(1<<i)))
{
if(!(d&(1<<i)))
ans=ans|(1<<i);
}
else if((d&(1<<i)))
{
cout<<-1<<endl;
return 0;
}
}
cout<<ans<<endl;
return 0;
Bit expression โ
cin>>a>>b>>c;
int d=a&b;
int ans=0;
for(int i=0;i<32;i++)
{
if((c&(1<<i)))
{
if(!(d&(1<<i)))
ans=ans|(1<<i);
}
else if((d&(1<<i)))
{
cout<<-1<<endl;
return 0;
}
}
cout<<ans<<endl;
return 0;
Bit expression โ