Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐DTCC is Hiring !!
Role: Software Engineer Intern [2024 Internship Program]
Batch: 2024
๐Apply here:
https://ebxr.fa.us2.oraclecloud.com/hcmUI/CandidateExperience/en/sites/CX_1/job/207375/
Role: Software Engineer Intern [2024 Internship Program]
Batch: 2024
๐Apply here:
https://ebxr.fa.us2.oraclecloud.com/hcmUI/CandidateExperience/en/sites/CX_1/job/207375/
DTCC Candidate Experience Site
Software Engineer Intern [2024 Internship Program]
DTCC offers 10-week summer internships for university students in several departments and locations around the globe. Internships are an opportunity to contribute to DTCCโs daily operations, while learning more about the company and the financial servicesโฆ
๐1
#include<stdio.h>
#include<stdlib.h>
#define MOD 1000000007
int compare(const void *a, const void *b) {
return (*(int*)a - *(int*)b);
}
int main() {
int N;
scanf("%d", &N);
if (N <= 1) {
printf("NO HOURS\n");
return 0;
}
int *A = (int*)malloc(N * sizeof(int));
for (int i = 0; i < N; i++) {
scanf("%d", &A[i]);
}
qsort(A, N, sizeof(int), compare);
int count = 0;
for (int i = 0; i < N - 1; i++) {
for (int j = i + 1; j < N; j++) {
if ((A[i] + A[j]) % 60 == 0) {
count = (count + 1) % MOD;
}
}
}
if (count > 0) {
printf("%d\n", count);
} else {
printf("NO HOURS\n");
}
free(A);
return 0;
}
Hours Count โ
NPCI
#include<stdlib.h>
#define MOD 1000000007
int compare(const void *a, const void *b) {
return (*(int*)a - *(int*)b);
}
int main() {
int N;
scanf("%d", &N);
if (N <= 1) {
printf("NO HOURS\n");
return 0;
}
int *A = (int*)malloc(N * sizeof(int));
for (int i = 0; i < N; i++) {
scanf("%d", &A[i]);
}
qsort(A, N, sizeof(int), compare);
int count = 0;
for (int i = 0; i < N - 1; i++) {
for (int j = i + 1; j < N; j++) {
if ((A[i] + A[j]) % 60 == 0) {
count = (count + 1) % MOD;
}
}
}
if (count > 0) {
printf("%d\n", count);
} else {
printf("NO HOURS\n");
}
free(A);
return 0;
}
Hours Count โ
NPCI
๐1
import java.util.*;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] a = new int[n];
for (int i = 0; i < n; i++) {
a[i] = sc.nextInt();
}
ArrayList<Integer> arr = new ArrayList<>();
int c = 1;
for (int i = 0; i < n - 1; i++) {
if (a[i] != a[i + 1]) {
arr.add(c);
c = 1;
} else {
c++;
}
}
arr.add(c);
int ans = 0;
if (arr.size() == 2) {
ans = Math.min(arr.get(0), arr.get(1)) * 2;
} else if (arr.size() > 2) {
ans = Collections.max(arr.subList(1, arr.size() - 1)) * 2;
}
System.out.println(ans);
}
}
Longest Mirror subArray
NPCIโ
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] a = new int[n];
for (int i = 0; i < n; i++) {
a[i] = sc.nextInt();
}
ArrayList<Integer> arr = new ArrayList<>();
int c = 1;
for (int i = 0; i < n - 1; i++) {
if (a[i] != a[i + 1]) {
arr.add(c);
c = 1;
} else {
c++;
}
}
arr.add(c);
int ans = 0;
if (arr.size() == 2) {
ans = Math.min(arr.get(0), arr.get(1)) * 2;
} else if (arr.size() > 2) {
ans = Collections.max(arr.subList(1, arr.size() - 1)) * 2;
}
System.out.println(ans);
}
}
Longest Mirror subArray
NPCIโ
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
#include<stdio.h> #include<stdlib.h> #define MOD 1000000007 int compare(const void *a, const void *b) { return (*(int*)a - *(int*)b); } int main() { int N; scanf("%d", &N); if (N <= 1) { printf("NO HOURS\n"); return 0; โฆ
Hours Count โ
#include<bits/stdc++.h>
using namespace std;
vector<int> solve(int Q, vector<vector<int>> queries) {
vector<int> ans, a(10005, 0);
for (vector<int>& query : queries) {
int type = query[0], element = query[1];
if (type == 0) {
a[element] = 1;
} else {
if (a[element]) {
ans.push_back(1);
a[element] = 0;
} else {
ans.push_back(0);
}
}
}
return ans;
}
BST Queries โ
using namespace std;
vector<int> solve(int Q, vector<vector<int>> queries) {
vector<int> ans, a(10005, 0);
for (vector<int>& query : queries) {
int type = query[0], element = query[1];
if (type == 0) {
a[element] = 1;
} else {
if (a[element]) {
ans.push_back(1);
a[element] = 0;
} else {
ans.push_back(0);
}
}
}
return ans;
}
BST Queries โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Opening For GIS Executive( 0-2 Year Only)
Location - Corporate Office Noida West.
Email:- Support@dvertex.com
Location - Corporate Office Noida West.
Email:- Support@dvertex.com
โค1
Split the bill โ
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐ฃ Job Title: Salesforce Developer (Freshers)
๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐
๐ข Company: VITTECH PVT LTD
๐Location: Pune
๐ Exp: 0- 1 Years
๐ฉ Mail: megha@vittech.in
๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐
๐ข Company: VITTECH PVT LTD
๐Location: Pune
๐ Exp: 0- 1 Years
๐ฉ Mail: megha@vittech.in
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐D. E. Shaw is Hiring !!
Role: Software Developer
Expected Salary: 20-40 LPA
๐Apply here: https://deshawindia.com/careers/all-positions-in-software-development-2614
Role: Software Developer
Expected Salary: 20-40 LPA
๐Apply here: https://deshawindia.com/careers/all-positions-in-software-development-2614
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐YASH Technologies is Hiring !!
Role: Trainee Programmer
Experience: 0-1 Years
Expected Salary: 4-6 LPA
๐Apply here: https://careers.yash.com/job/Indore-Trainee-Programmer-Advance-Java%2C-JEE-%28JSPServletsJTA%29-Job/947020210/
Role: Trainee Programmer
Experience: 0-1 Years
Expected Salary: 4-6 LPA
๐Apply here: https://careers.yash.com/job/Indore-Trainee-Programmer-Advance-Java%2C-JEE-%28JSPServletsJTA%29-Job/947020210/
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐Deloitte is hiring !!
Role: Java Developer (0-1 years)
Expected Salary: 7 - 12 LPA
๐Apply here: https://jobsindia.deloitte.com/job/Bengaluru-Enabling-Areas-Java-Developer-Executive-DEC/23153444/
Role: Java Developer (0-1 years)
Expected Salary: 7 - 12 LPA
๐Apply here: https://jobsindia.deloitte.com/job/Bengaluru-Enabling-Areas-Java-Developer-Executive-DEC/23153444/
vector<vector<int>> dp;
int recur(vector<int>& h,int pos,int r_x, int r_y,int n)
{
if(pos>=n) return 0;
if(dp[pos][abs(r_x-r_y)]!=-1) return dp[pos][abs(r_x-r_y)];
int v1=0,v2=0,v3=0;
if(r_x>=h[pos]){
v1=1+recur(h,pos+1,r_x-h[pos],r_y,n);
}
if(r_y>=h[pos]){
v2=1+recur(h,pos+1,r_x,r_y-h[pos],n);
}
v3=recur(h,pos+1,r_x,r_y,n);
return dp[pos][abs(r_x-r_y)]=max(v1,max(v2,v3));
}
int solution(vector<int>&h,int n,int x,int y)
{
dp.resize(n,vector<int>(max(x,y)+1,-1));
return recur(h,0,x,y,n);
}
Microsoft โ
int recur(vector<int>& h,int pos,int r_x, int r_y,int n)
{
if(pos>=n) return 0;
if(dp[pos][abs(r_x-r_y)]!=-1) return dp[pos][abs(r_x-r_y)];
int v1=0,v2=0,v3=0;
if(r_x>=h[pos]){
v1=1+recur(h,pos+1,r_x-h[pos],r_y,n);
}
if(r_y>=h[pos]){
v2=1+recur(h,pos+1,r_x,r_y-h[pos],n);
}
v3=recur(h,pos+1,r_x,r_y,n);
return dp[pos][abs(r_x-r_y)]=max(v1,max(v2,v3));
}
int solution(vector<int>&h,int n,int x,int y)
{
dp.resize(n,vector<int>(max(x,y)+1,-1));
return recur(h,0,x,y,n);
}
Microsoft โ
bool help(int n,unordered_set<char>&mpp)
{
string s=to_string(n);
for(auto it:s)
{
if(mpp.count(it)) return 1;
}
return 0;
}
int solve(vector<int>&a,int n)
{
sort(a.begin(),a.end());
int maxi=a[n-1];
string s=to_string(maxi);
unordered_set<char>mpp;
for(auto it:s) mpp.insert(it);
int ans=-1;
for(int i=0;i<n-1;i++)
{
if(help(a[i],mpp)==0) ans=a[i];
}
if(ans==-1) return -1;
return ans+maxi;
}
Microsoft โ
{
string s=to_string(n);
for(auto it:s)
{
if(mpp.count(it)) return 1;
}
return 0;
}
int solve(vector<int>&a,int n)
{
sort(a.begin(),a.end());
int maxi=a[n-1];
string s=to_string(maxi);
unordered_set<char>mpp;
for(auto it:s) mpp.insert(it);
int ans=-1;
for(int i=0;i<n-1;i++)
{
if(help(a[i],mpp)==0) ans=a[i];
}
if(ans==-1) return -1;
return ans+maxi;
}
Microsoft โ
Budget planning โ
#include <bits/stdc++.h>
using namespace std;
int n;
int a[30];
int memo[1 << 23];
int inf = 100;
int solve(int flag){
if(memo[flag] != -1) return memo[flag];
if(flag == 1) return 1;
int ret = inf;
int b = __builtin_popcount(flag);
for(int i = n - 1; i >= 0; i--){
if(flag & (1 << i)){
int next = (flag ^ (1 << i)) | (1 << (i - 1));
for(int j=0;j<i;j++)for(int k=0;k<j+1;k++){
if(a[j] + a[k] == a[i]){
int tmp = solve(next | (1 << j) | (1 << k));
if(tmp != inf){
ret = min(ret, max(b, tmp));
}
}
}
break;
}
}
return memo[flag] = ret;
}
int main(){
cin>>n;
for(int i=0;i<n;i++)
{cin>>a[i];
}
memset(memo, -1, sizeof(memo));
int ans = solve(1 << (n - 1));
if(ans == inf) ans = -1;
cout<<ans<<endl;
}
#include <bits/stdc++.h>
using namespace std;
int n;
int a[30];
int memo[1 << 23];
int inf = 100;
int solve(int flag){
if(memo[flag] != -1) return memo[flag];
if(flag == 1) return 1;
int ret = inf;
int b = __builtin_popcount(flag);
for(int i = n - 1; i >= 0; i--){
if(flag & (1 << i)){
int next = (flag ^ (1 << i)) | (1 << (i - 1));
for(int j=0;j<i;j++)for(int k=0;k<j+1;k++){
if(a[j] + a[k] == a[i]){
int tmp = solve(next | (1 << j) | (1 << k));
if(tmp != inf){
ret = min(ret, max(b, tmp));
}
}
}
break;
}
}
return memo[flag] = ret;
}
int main(){
cin>>n;
for(int i=0;i<n;i++)
{cin>>a[i];
}
memset(memo, -1, sizeof(memo));
int ans = solve(1 << (n - 1));
if(ans == inf) ans = -1;
cout<<ans<<endl;
}
Minimum contrast โ
#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define N 300009
int dp[59][59];
string s[N],t,p,ans;
int f(int i,int j)
{
if(i==t.size())
return p.size()-j;
if(j==p.size())
return t.size()-i;
if(dp[i][j]!=-1)
return dp[i][j];
if(t[i]==p[j])
return dp[i][j] = f(i+1,j+1);
return dp[i][j] = 1 + min({ f(i+1,j), f(i,j+1), f(i+1,j+1)});
}
int main()
{
ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
int n;
cin>>n;
int i=0;
while(i<n)
cin>>s[i++];
int q,best,j,k;
cin>>q;
while(q--)
{
cin>>t;
best=INT_MAX;
i=0;
while(i<n)
{
p=s[i];
j=0;
while(j<t.size())
{
k=0;
while(k<p.size())
{
dp[j][k]=-1;
k++;
}
j++;
}
j=f(0,0);
if(j<best)
{
best=j;
ans=p;
}
i++;
}
cout << ans << "\n";
}
}
#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define N 300009
int dp[59][59];
string s[N],t,p,ans;
int f(int i,int j)
{
if(i==t.size())
return p.size()-j;
if(j==p.size())
return t.size()-i;
if(dp[i][j]!=-1)
return dp[i][j];
if(t[i]==p[j])
return dp[i][j] = f(i+1,j+1);
return dp[i][j] = 1 + min({ f(i+1,j), f(i,j+1), f(i+1,j+1)});
}
int main()
{
ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
int n;
cin>>n;
int i=0;
while(i<n)
cin>>s[i++];
int q,best,j,k;
cin>>q;
while(q--)
{
cin>>t;
best=INT_MAX;
i=0;
while(i<n)
{
p=s[i];
j=0;
while(j<t.size())
{
k=0;
while(k<p.size())
{
dp[j][k]=-1;
k++;
}
j++;
}
j=f(0,0);
if(j<best)
{
best=j;
ans=p;
}
i++;
}
cout << ans << "\n";
}
}