from collections import deque
def can_reach_all_with_p(teammates, P):
n = len(teammates)
graph = [[] for _ in range(n)]
for i in range(n):
for j in range(n):
if i != j:
dist = abs(teammates[i][0] - teammates[j][0]) + abs(teammates[i][1] - teammates[j][1])
if dist <= P:
graph[i].append(j)
def bfs(start):
visited = [False] * n
q = deque([start])
visited[start] = True
count = 1
while q:
node = q.popleft()
for neighbor in graph[node]:
if not visited[neighbor]:
visited[neighbor] = True
q.append(neighbor)
count += 1
return count == n
for i in range(n):
if bfs(i):
return True
return False
def min_initial_points(teammates):
left, right = 0, 2 * 10**9
while left < right:
mid = (left + right) // 2
if can_reach_all_with_p(teammates, mid):
right = mid
else:
left = mid + 1
return left
Reach teammate
Groww โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐Bank of America Hiring Apprentice
Qualification:
Final year Graduates from the Class of 2025 ONLY
- Must Have Major Specialization in Computer Science & Information Technology ONLY
- Must have scored 60% in the last semester OR CGPA of 6 on a scale of 10 in the last semester
- No Active Backlogs in any of the current or prior semesters
- Students should be willing to join any of the roles/skills/segment as per company requirement
- Students should be willing to work in any shifts/night shifts as per company requirement
- Students should be willing to work in any locations namely โ Mumbai, Chennai, Gurugram, Gandhinagar (GIFT), Hyderabad as per company requirement
๐ปApply: https://careers.bankofamerica.com/en-us/job-detail/24035855/apprentice-multiple-locations
Qualification:
Final year Graduates from the Class of 2025 ONLY
- Must Have Major Specialization in Computer Science & Information Technology ONLY
- Must have scored 60% in the last semester OR CGPA of 6 on a scale of 10 in the last semester
- No Active Backlogs in any of the current or prior semesters
- Students should be willing to join any of the roles/skills/segment as per company requirement
- Students should be willing to work in any shifts/night shifts as per company requirement
- Students should be willing to work in any locations namely โ Mumbai, Chennai, Gurugram, Gandhinagar (GIFT), Hyderabad as per company requirement
๐ปApply: https://careers.bankofamerica.com/en-us/job-detail/24035855/apprentice-multiple-locations
Bankofamerica
Bank of America Error Page
Please Try Again
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐ Naukri Campus Young Turks Skill Assessment Test ๐
Your chance to showcase your skills in demand by employers by taking two tests.
Eligibility : Students currently pursuing UG courses and 2024 undergraduates looking for their first job ( BA, B.Com, B.Sc, B.Tech, BBA, BCA & more)
Round 1 : Basic Aptitude Test
Round 2 : Skills Test in fields like coding & six other areas
Rewards ๐: Earn merit certificates from top brands to enhance your CV, even win cash prizes, goodies up to Rs. 20,00,000! ๐ถ
Enroll Here ๐ : https://feji.us/zh7zag
Your chance to showcase your skills in demand by employers by taking two tests.
Eligibility : Students currently pursuing UG courses and 2024 undergraduates looking for their first job ( BA, B.Com, B.Sc, B.Tech, BBA, BCA & more)
Round 1 : Basic Aptitude Test
Round 2 : Skills Test in fields like coding & six other areas
Rewards ๐: Earn merit certificates from top brands to enhance your CV, even win cash prizes, goodies up to Rs. 20,00,000! ๐ถ
Enroll Here ๐ : https://feji.us/zh7zag
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Adidas is hiring Junior Data and Platform Engineer
For 2022, 2023 grads
Location: Gurugram
https://jobs.adidas-group.com/adidas/job/Gurgaon-Junior-Data-&-Platform-Engineer-HR/1113244801/?feedId=301201
For 2022, 2023 grads
Location: Gurugram
https://jobs.adidas-group.com/adidas/job/Gurgaon-Junior-Data-&-Platform-Engineer-HR/1113244801/?feedId=301201
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name : Qualcomm
Role : Software Engineer (Test)
Batch : 2023 passouts - ECE/CS
Mail your resume to : aayushar@qti.qualcomm.com
Role : Software Engineer (Test)
Batch : 2023 passouts - ECE/CS
Mail your resume to : aayushar@qti.qualcomm.com
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Linkedin
Rohan . on LinkedIn: We are hiring for the SDE Intern for Remote(Work from Home Location).
Noteโฆ | 45 comments
Noteโฆ | 45 comments
We are hiring for the SDE Intern for Remote(Work from Home Location).
Note - Its Internship not Full Time
Kindly dm with resume, | 45 comments on LinkedIn
Note - Its Internship not Full Time
Kindly dm with resume, | 45 comments on LinkedIn
๐1
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int solve(const vector<int>& arr) {
int n = arr.size();
int a = 0;
for (int i = 0; i < n; i++) {
if (arr[i] == 1) a++;
}
if (a == n) {
return n - 1;
}
vector<int> f(n);
for (int i = 0; i < n; i++) {
f[i] = (arr[i] == 1) ? -1 : 1;
}
int m = f[0], v = f[0];
for (int i = 1; i < n; i++) {
v = max(f[i], v + f[i]);
m = max(m, v);
}
int e = a + m;
return e;
}
flipping frenzy gameโ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
TCS Codevita is back with its 12 edition!!
Batch eligible: 2025, 2026, 2027 and 2028 grads
Apply: https://codevita.tcsapps.com/
Batch eligible: 2025, 2026, 2027 and 2028 grads
Apply: https://codevita.tcsapps.com/
Tcsapps
TCS CodeVita | Home
TCS CodeVita, a programming contest, is TCS' way of attracting young impressionable college students to adopt this culture and experience joy of programming.
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: PhonePe
Role: Software Engineer - Backend
YOE: 0-2 years
Apply: https://boards.greenhouse.io/embed/job_app?token=5890043003&gh_src=961e65dc3us
Role: Software Engineer - Backend
YOE: 0-2 years
Apply: https://boards.greenhouse.io/embed/job_app?token=5890043003&gh_src=961e65dc3us
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Linkedin
Devendra Yadav on LinkedIn: #oextechsolutions #shopifydeveloper #techjobs #ecommerce #hiringโฆ
๐ Weโre Hiring: Entry-Level Shopify Developer at OEX Tech Solutions Pvt Ltd! ๐
๐ Location: Noida
๐ Experience: 0-2 Years
๐ผ Job Type: Full-Time
Are youโฆ
๐ Location: Noida
๐ Experience: 0-2 Years
๐ผ Job Type: Full-Time
Are youโฆ
int warpedSpell(int secret) {
if(secret <= 1001) return 1001;
if(secret >= 9999999) return 9999999;
string secretStr = to_string(secret);
int n = secretStr.length();
string warpedStr = secretStr;
for (int i = 0; i < (n + 1) / 2; ++i) {
warpedStr[n - i - 1] = warpedStr[i];
}
if (warpedStr > secretStr) {
return stoi(warpedStr);
}
for (int i = (n - 1) / 2; i >= 0; --i) {
if (warpedStr[i] < '9') {
warpedStr[i]++;
break;
}
warpedStr[i] = '0';
}
for (int i = 0; i < (n + 1) / 2; ++i) {
warpedStr[n - i - 1] = warpedStr[i];
}
if (warpedStr[0] == '0') {
warpedStr = "1" + warpedStr;
warpedStr[n] = '1';
}
return stoi(warpedStr);
}
Thoughtwork โ
if(secret <= 1001) return 1001;
if(secret >= 9999999) return 9999999;
string secretStr = to_string(secret);
int n = secretStr.length();
string warpedStr = secretStr;
for (int i = 0; i < (n + 1) / 2; ++i) {
warpedStr[n - i - 1] = warpedStr[i];
}
if (warpedStr > secretStr) {
return stoi(warpedStr);
}
for (int i = (n - 1) / 2; i >= 0; --i) {
if (warpedStr[i] < '9') {
warpedStr[i]++;
break;
}
warpedStr[i] = '0';
}
for (int i = 0; i < (n + 1) / 2; ++i) {
warpedStr[n - i - 1] = warpedStr[i];
}
if (warpedStr[0] == '0') {
warpedStr = "1" + warpedStr;
warpedStr[n] = '1';
}
return stoi(warpedStr);
}
Thoughtwork โ
import re
def orderNumberFinder(message):
pattern = r'\b\d{3}[-. ]?\d{4}[-. ]?[A-Z]\b'
if re.search(pattern, message):
return 1
else:
return 0
Thoughtwork โ
def orderNumberFinder(message):
pattern = r'\b\d{3}[-. ]?\d{4}[-. ]?[A-Z]\b'
if re.search(pattern, message):
return 1
else:
return 0
Thoughtwork โ
#include <climits>
#include <iostream>
#include <unordered_map>
#include <vector>
using namespace std;
int t[31];
int sol(int i, unordered_map<int, int>& h)
{
if (i >= 30)
return 0;
else if (t[i] != -1)
return t[i];
int min_value = INT_MAX;
for (int j = 1; j <= 6; j++) {
int k = i + j;
if (h.count(k) > 0) {
if (h[k] < k)
continue;
k = h[k];
}
min_value = min(min_value, sol(k, h) + 1);
}
t[i] = min_value;
return t[i];
}
int min_throw(int n, vector<int> arr)
{
for (int i = 0; i < 31; i++) {
t[i] = -1;
}
unordered_map<int, int> h;
for (int i = 0; i < 2 * n; i += 2) {
h[arr[i]] = arr[i + 1];
}
return sol(1, h);
}
Winning Strategy โ
double solve(int n,int k,int row,int col,vector<vector<vector<double>>>&dp)
{
if(k==0) return 1;
int dx[8]={2,1,-1,-2,-2,-1,1,2};
int dy[8]={1,2,2,1,-1,-2,-2,-1};
double ans=0;
if(dp[k][row][col]!=-1) return dp[k][row][col];
for(int i=0;i<8;i++)
{
int nrow=row+dx[i];
int ncol=col+dy[i];
if(nrow>=0 and ncol>=0 and nrow<n and ncol<n) ans+=solve(n,k-1,nrow,ncol,dp);
}
return dp[k][row][col]=ans/8;
}
double knightProbability(int n, int k, int row, int column) {
vector<vector<vector<double>>>dp(k+1,vector<vector<double>>(n+1,vector<double>(n+1,-1)));
return solve(n,k,row,column,dp);
}
Still There โ
{
if(k==0) return 1;
int dx[8]={2,1,-1,-2,-2,-1,1,2};
int dy[8]={1,2,2,1,-1,-2,-2,-1};
double ans=0;
if(dp[k][row][col]!=-1) return dp[k][row][col];
for(int i=0;i<8;i++)
{
int nrow=row+dx[i];
int ncol=col+dy[i];
if(nrow>=0 and ncol>=0 and nrow<n and ncol<n) ans+=solve(n,k-1,nrow,ncol,dp);
}
return dp[k][row][col]=ans/8;
}
double knightProbability(int n, int k, int row, int column) {
vector<vector<vector<double>>>dp(k+1,vector<vector<double>>(n+1,vector<double>(n+1,-1)));
return solve(n,k,row,column,dp);
}
Still There โ
๐1
class Solution {
public int solution(int[] p, int[] s) {
int n = p.length;
int totalS = 0, totalP = 0;
for (int i = 0; i < n; i++) {
totalS += s[i];
totalP += p[i];
}
Arrays.sort(s);
int cars = 0;
for (int i = n - 1; i >= 0; i--) {
totalP -= s[i];
cars++;
if (totalP <= 0) break;
}
return cars;
}
}
public int solution(int[] p, int[] s) {
int n = p.length;
int totalS = 0, totalP = 0;
for (int i = 0; i < n; i++) {
totalS += s[i];
totalP += p[i];
}
Arrays.sort(s);
int cars = 0;
for (int i = n - 1; i >= 0; i--) {
totalP -= s[i];
cars++;
if (totalP <= 0) break;
}
return cars;
}
}
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐Tetra Looking for Freshers
Linux - Red Hat Certified Engineers
Mode of Work : Remote
Interested candidates may mail resumes to recruitment@tetrain.com
๐Red Hat Certification mandatory !!
Linux - Red Hat Certified Engineers
Mode of Work : Remote
Interested candidates may mail resumes to recruitment@tetrain.com
๐Red Hat Certification mandatory !!
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Rubrik OA โ
def oracles(n, q, ops, qs):
a = []
for b, x in ops:
if b == 1:
a.append(x)
else:
a = a * (x + 1)
return [a[i-1] if i <= len(a) else 0 for i in qs]
n, q = map(int, input().split())
ops = [map(int, input().split()) for _ in range(n)]
qs = list(map(int, input().split()))
print(*oracles(n, q, ops, qs))
The Oracles โ
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Rubrik OA โ
MAX_N = 100000
e = [0] * MAX_N
def canSplit(n, k, b):
maxSum = 0
s = 0
br = 0
for i in range(n):
if s + e[i] > k or br == b - 1:
br += 1
s = e[i]
else:
s += e[i]
maxSum = max(maxSum, s)
if br >= b:
return False
return maxSum <= k
def minBranches(n, k):
l, r = 1, n
while l < r:
mid = l + (r - l) // 2
if canSplit(n, k, mid):
r = mid
else:
l = mid + 1
return l if canSplit(n, k, l) else -1
def main():
import sys
input = sys.stdin.read
data = input().split()
n, m, k = map(int, data[:3])
global e
e = list(map(int, data[3:3+n]))
print(minBranches(n, k))
if __name__ == "__main__":
main()
Save the universeโ
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Rubrik OA โ
#define ff first
#define ss second
struct minq{
stack<pair<int,int>>s,t;
void push(int x){
int mn=(s.size()>0)?min(s.top().ss,x):x;
s.push({x,mn});
}
void pop(){
if(t.empty()){
while(!s.empty()){
auto x=s.top();
int mn=(t.size()>0)?min(x.ff,t.top().ss):x.ff;
t.push({x.ff,mn});
s.pop();
}
}
t.pop();
}
int getmin(){
int mn=INT_MAX;
if(s.size())mn=min(mn,s.top().ss);
if(t.size())mn=min(mn,t.top().ss);
return mn;
}
};
bool ok(string &s,vector<int>&a,int mid){
minq v;
for(int i=0;i<mid;i++){
v.push(a[s[i]-'a']);
}
bool alpha=v.getmin()>=mid;
for(int i=mid;i<s.size();i++){
v.pop();
v.push(a[s[i]-'a']);
alpha|=(v.getmin()>=mid);
}
return alpha;
}
int getLongest(string &s,vector<int>&a){
int st=0,en=s.size()-1;
while(en-st>1){
int mid=(en+st+1)/2;
if(ok(s,a,mid)){
st=mid;
}
else en=mid;
}
if(ok(s,a,en))return en;
else return st;
}
vector<int>solve(vector<string>universe,vector<vector<int>>s){
vector<int>ans;
int n=universe.size();
for(int i=0;i<n;i++){
ans.push_back(getLongest(universe[i],s[i]));
}
return ans;
}
Anti Aging Serum โ