#include <iostream>
#include <vector>
using namespace std;
bool hasConsecutiveOnes(int num) {
return (num & (num >> 1)) != 0;
}
int solve(int p) {
if (!hasConsecutiveOnes(p)) {
return p;
}
int mask = 1;
for (int i = 30; i >= 0; --i) {
int bit_i = (p >> i) & 1;
int bit_i_next = (p >> (i + 1)) & 1;
if (bit_i == 1 && bit_i_next == 1) {
mask = (1 << (i + 1)) - 1;
p = (p & ~mask) + (1 << (i + 1));
break;
}
}
return solve(p);
}
int main() {
int t;
cin >> t;
while (t--) {
int p;
cin >> p;
cout << solve(p) << endl;
}
return 0;
}
AMD โ
โค1
async function pulseRate(diagnosisName, doctorId) {
const apiUrl = 'https://jsonmock.hackerrank.com/api/medical_records';
let currentPage = 1;
let totalPages = 1;
let sumPulseRate = 0;
let totalCount = 0;
do {
const response = await fetch(${apiUrl}?page=${currentPage});
const data = await response.json();
totalCount = data.total;
totalPages = data.total_pages;
const records = data.data || [];
sumPulseRate += records.reduce((acc, record) => acc + record.vitals.pulse, 0);
currentPage++;
} while (currentPage <= totalPages);
const averagePulseRate = Math.trunc(sumPulseRate / totalCount);
return averagePulseRate;
}
โค1
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
#include <bits/stdc++.h>
using namespace std;
#define ll long long
map<string, map<string, ll>> user;
map<string, ll> users;
set<string> banks;
vector<string> split(const string &s) {
stringstream ss(s);
vector<string> result;
string token;
while (getline(ss, token, ',')) {
result.push_back(token);
}
return result;
}
void init(string &s) {
vector<string> bankers = split(s);
ll balance = stoll(bankers[2]);
users[bankers[1]] = balance;
for (int i = 3; i < bankers.size(); i++) {
user[bankers[1]].insert({bankers[i], balance});
banks.insert(bankers[i]);
}
}
string post(string &s) {
vector<string> help = split(s);
ll value = stoll(help[4]);
if (banks.find(help[2]) != banks.end() && banks.find(help[3]) != banks.end())
return "FAILURE";
if (banks.find(help[3]) != banks.end()) {
if (users.find(help[2]) == users.end()) return "FAILURE";
if (user[help[2]].find(help[3]) == user[help[2]].end()) return "FAILURE";
if (users[help[2]] < value) return "FAILURE";
users[help[2]] -= value;
return "SUCCESS";
}
if (banks.find(help[2]) != banks.end()) {
if (users.find(help[3]) == users.end()) return "FAILURE";
if (user[help[3]].find(help[2]) == user[help[3]].end()) return "FAILURE";
users[help[3]] += value;
return "SUCCESS";
}
if (users.find(help[2]) == users.end() || users.find(help[3]) == users.end()) return "FAILURE";
if (users[help[2]] < value) return "FAILURE";
users[help[2]] -= value;
users[help[3]] += value;
return "SUCCESS";
}
string get(string &s) {
vector<string> help = split(s);
if (users.find(help[2]) == users.end()) return "FAILURE";
return to_string(users[help[2]]);
}
static bool comp(const string &x, const string &y) {
vector<string> a = split(x);
vector<string> b = split(y);
return stoll(a[1]) < stoll(b[1]);
}
string get_command_results(vector<string> commands) {
vector<string> check;
for (auto &it : commands) {
if (it[0] == 'I') {
init(it);
} else {
check.push_back(it);
}
}
sort(check.begin(), check.end(), comp);
map<string, string> res;
for (auto &it : check) {
if (it[0] == 'P') {
res[it] = post(it);
}
if (it[0] == 'G') {
res[it] = get(it);
}
}
string ans;
for (auto &it : commands) {
if (res.find(it) != res.end()) {
if (!ans.empty()) ans += ",";
ans += res[it];
}
}
return ans;
}
Account Balance manager : StripePay Backend โ
Stripe โ
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
#include <iostream>
#include <vector>
#include <string>
using namespace std;
bool s(const string& s1, const string& s2) {
if (s1.size() != s2.size()) return false;
int diffCount = 0;
for (int i = 0; i < s1.size(); ++i) {
if (s1[i] != s2[i]) {
diffCount++;
}
if (diffCount > 1) return false;
}
return (diffCount == 1);
}
vector<string> solve(const vector<string>& start, const vector<string>& fin) {
vector<string> result(fin.size(), "NO");
for (int i = 0; i < fin.size(); ++i) {
for (const string& startStr : start) {
if (s(startStr, fin[i])) {
result[i] = "YES";
break;
}
}
}
return result;
}
int main() {
int n, m;
cin >> n;
vector<string> start(n);
for (int i = 0; i < n; ++i) {
cin >> start[i];
}
cin >> m;
vector<string> fin(m);
for (int i = 0; i < m; ++i) {
cin >> fin[i];
}
vector<string> result = solve(start, fin);
for (const string& res : result) {
cout << res << endl;
}
return 0;
}
String operation โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name : Snowflake
Hackathon Name : Snowflake AI Hackathon 2024
Batch : College Students + Working Professionals
Link : https://bit.ly/SnowflakeAIHackathon
Last date to register is asap.
Hackathon Name : Snowflake AI Hackathon 2024
Batch : College Students + Working Professionals
Link : https://bit.ly/SnowflakeAIHackathon
Last date to register is asap.
Techgig
1st AI for Good Hackathon Online Contest at Techgig.com
1st AI for Good Hackathon - Participate in the 1st AI for Good Hackathon. Best way to test your Cloud,Artificial Intelligence,Machine learning,Data Science skills. Register yourself for the 1st AI for Good Hackathon test and win prizes online on Techgig.com
โค1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Pazy is hiring for Fullstack Software Development Intern
Experience: 0 - 1 year's
Expected Stipend: 4-5 LPA
Apply here: https://wellfound.com/jobs/2835447-fullstack-software-development-internship-development
Experience: 0 - 1 year's
Expected Stipend: 4-5 LPA
Apply here: https://wellfound.com/jobs/2835447-fullstack-software-development-internship-development
๐คฎ1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
ReachInbox is hiring for Backend Engineer Intern
Experience: 0 - 1 year's
Expected Stipend: 3-5 LPA
Apply here: https://wellfound.com/jobs/3115909-backend-engineer-intern
Experience: 0 - 1 year's
Expected Stipend: 3-5 LPA
Apply here: https://wellfound.com/jobs/3115909-backend-engineer-intern
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐Pentair is hiring for Associate Engineer, Trainee-1
Experience: 0 - 1 year's
Expected Salary: 6-10 LPA
Apply here: https://pentair.wd5.myworkdayjobs.com/Pentair_Careers/job/Noida/Associate-Engineer--Trainee-1_R19776
๐FloBiz is hiring for SDE 1 - Backend Engineer
Experience: 1 year's
Expected Salary: 10-20 LPA
Apply here: https://valorem.keka.com/careers/jobdetails/69890
๐Tekion Corp is hiring for React Native Developer
Experience: 0 - 1 year's
Expected Salary: 20-30 LPA
Apply here: https://www.linkedin.com/jobs/view/4053251093/
Experience: 0 - 1 year's
Expected Salary: 6-10 LPA
Apply here: https://pentair.wd5.myworkdayjobs.com/Pentair_Careers/job/Noida/Associate-Engineer--Trainee-1_R19776
๐FloBiz is hiring for SDE 1 - Backend Engineer
Experience: 1 year's
Expected Salary: 10-20 LPA
Apply here: https://valorem.keka.com/careers/jobdetails/69890
๐Tekion Corp is hiring for React Native Developer
Experience: 0 - 1 year's
Expected Salary: 20-30 LPA
Apply here: https://www.linkedin.com/jobs/view/4053251093/
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
CGI is hiring for Associate Software Engineer
2023/2024 batch passouts
JD : https://cgi.njoyn.com/corp/xweb/xweb.asp?clid=21001&page=jobdetails&jobid=J1024-1097&BRID=1162873&SBDID=943&LANG=1
Send resume for referral : Rajan.das@cgi.com
2023/2024 batch passouts
JD : https://cgi.njoyn.com/corp/xweb/xweb.asp?clid=21001&page=jobdetails&jobid=J1024-1097&BRID=1162873&SBDID=943&LANG=1
Send resume for referral : Rajan.das@cgi.com
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Boston Consulting Group ( BCG)
Role : AI Engineer
Batch : 2023/2022/2021 passout
Apply Link : https://careers.bcg.com/global/en/job/25791/AI-Engineer-India-BCG-X
Role : AI Engineer
Batch : 2023/2022/2021 passout
Apply Link : https://careers.bcg.com/global/en/job/25791/AI-Engineer-India-BCG-X
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
wiZe( myLamp AI ) is hiring for Developer Intern [ Front End / Backend ]
Work From Home
2027 / 2026 / 2025 batch graduates eligible
Perks :
- Paid Intern opportunity
- Letter of recommendation
- Real Work Experience
Apply Here : https://t.ly/C6pAc
Work From Home
2027 / 2026 / 2025 batch graduates eligible
Perks :
- Paid Intern opportunity
- Letter of recommendation
- Real Work Experience
Apply Here : https://t.ly/C6pAc
Unstop
Developer Intern [Front End / Backend] - wiZe(myLamp AI) | 1186072 // Unstop
Click the link to apply for Developer Intern [Front End / Backend] at wiZe(myLamp AI). | 2024 | 1186072
๐2
#include <iostream>
#define ll long long
#include <vector>
using namespace std;
ll minSelectionsInWorstCase(vector<int>& choices) {
ll n = choices.size();
vector<int> s(n, 0);
ll t = 0;
s[n - 1] = choices[n - 1];
for (int i = n - 2; i >= 0; --i) {
s[i] = choices[i] + s[i + 1];
}
t = s[0];
return t;
}
Backbencher and bug โ
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: Micron Technology
Role: Associate Software Engineer
Batch eligible: 2023 and 2024 grads
Apply: https://careers.micron.com/careers/job/25632471
Role: Associate Software Engineer
Batch eligible: 2023 and 2024 grads
Apply: https://careers.micron.com/careers/job/25632471
Micron
Careers at Micron Technology
Careers site
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: NTT Data
Role: Associate Software Development Engineer
Batch eligible: 2023 and 2024 grads
Apply: https://careers.services.global.ntt/global/en/job/R-121248/apply
Role: Associate Software Development Engineer
Batch eligible: 2023 and 2024 grads
Apply: https://careers.services.global.ntt/global/en/job/R-121248/apply
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
FealtyX - Catagrowth Technologies
Web Developer | React JS/Next JS
Experience: Freshers
Role - Full Time (Bangalore)
Package: 3 - 5 LPA
Reach out - hr@fealtyx.com
Web Developer | React JS/Next JS
Experience: Freshers
Role - Full Time (Bangalore)
Package: 3 - 5 LPA
Reach out - hr@fealtyx.com
๐2
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐Commvault Hiring
Role: Intern Development
Batch: 2025
Location: Bangalore, Karnataka
๐ป Apply here: https://careers.commvault.com/us/en/job/COMCOMUSR0010645EXTERNALENUS/Intern-Development
Role: Intern Development
Batch: 2025
Location: Bangalore, Karnataka
๐ป Apply here: https://careers.commvault.com/us/en/job/COMCOMUSR0010645EXTERNALENUS/Intern-Development
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Linkedin
Yasmina Ghonemy on LinkedIn: #hiring #java #fresher #junior #capgeminiegypt
Exciting Career Opportunity at Capgemini Egypt!
We are thrilled to announce that we are hiring Junior Java Developers ...
Who Are We Looking For?
โข Recentโฆ
We are thrilled to announce that we are hiring Junior Java Developers ...
Who Are We Looking For?
โข Recentโฆ