๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
#include <iostream>
#include <string>
using namespace std;
string solution(string &S, string &T) {
int n = S.size();
int m = T.size();
if (S == T) {
return "NOTHING";
}
if (m == n + 1 && T.substr(0, n) == S) {
return "ADD " + string(1, T[n]);
}
if (n == m + 1) {
for (int i = 0; i < n - 1; i++) {
if (S[i] == S[i + 1]) {
string mergedS = S.substr(0, i) + S.substr(i + 1);
if (mergedS == T) {
return "JOIN " + string(1, S[i]);
}
}
}
}
if (n == m) {
int first_diff = -1, second_diff = -1;
for (int i = 0; i < n; ++i) {
if (S[i] != T[i]) {
if (first_diff == -1) {
first_diff = i;
} else if (second_diff == -1) {
second_diff = i;
} else {
return "IMPOSSIBLE";
}
}
}
if (second_diff != -1 && S[first_diff] == T[second_diff] && S[second_diff] == T[first_diff]) {
return "SWAP " + string(1, S[first_diff]) + " " + string(1, S[second_diff]);
}
}
return "IMPOSSIBLE";
}
Palo Alto โ
import java.util.HashMap;
class Solution {
public int solution(String S) {
int maxLength = 0;
for (int start = 0; start < S.length(); start++) {
HashMap<Character, Integer> charCount = new HashMap<>();
for (int end = start; end < S.length(); end++) {
char currentChar = S.charAt(end);
charCount.put(currentChar, charCount.getOrDefault(currentChar, 0) + 1);
if (allEven(charCount)) {
maxLength = Math.max(maxLength, end - start + 1);
}
}
}
return maxLength;
}
private boolean allEven(HashMap<Character, Integer> charCount) {
for (int count : charCount.values()) {
if (count % 2 != 0) {
return false;
}
}
return true;
}
Palo Alto โ
#include <iostream>
using namespace std;
class TreeNode {
public:
int x;
TreeNode* left;
TreeNode* right;
TreeNode(int value) : x(value), left(nullptr), right(nullptr) {}
};
class Solution {
public:
TreeNode* solution(TreeNode* T) {
if (!T) return nullptr;
if (!T->left && !T->right) {
TreeNode* newNode = new TreeNode(T->x);
newNode->left = new TreeNode(T->x);
newNode->right = new TreeNode(T->x);
return newNode;
}
if (T->left) {
T->left = solution(T->left);
}
if (T->right) {
T->right = solution(T->right);
}
return T;
}
};
public static int minStrength(int N, int M, int[][] strength, int[][] confidence) {
int left = 1, right = 1000000;
while (left < right) {
int mid = left + (right - left) / 2;
if (canCross(N, M, strength, confidence, mid)) {
right = mid;
} else {
left = mid + 1;
}
}
return left;
}
private static boolean canCross(int N, int M, int[][] strength, int[][] confidence, int initialStrength) {
int currentStrength = initialStrength;
for (int i = 0; i < N; i++) {
for (int j = 0; j < M; j++) {
if (currentStrength < strength[i][j]) {
return false;
}
currentStrength += confidence[i][j];
}
}
return true;
}
Acolite โ
int left = 1, right = 1000000;
while (left < right) {
int mid = left + (right - left) / 2;
if (canCross(N, M, strength, confidence, mid)) {
right = mid;
} else {
left = mid + 1;
}
}
return left;
}
private static boolean canCross(int N, int M, int[][] strength, int[][] confidence, int initialStrength) {
int currentStrength = initialStrength;
for (int i = 0; i < N; i++) {
for (int j = 0; j < M; j++) {
if (currentStrength < strength[i][j]) {
return false;
}
currentStrength += confidence[i][j];
}
}
return true;
}
Acolite โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Twilio Hiring SWE Interns
Batch: 3rd Year students or 2026 Batch
Apply
https://job-boards.greenhouse.io/twilio/jobs/6267229?gh_src=krishankumarlinkedin
Batch: 3rd Year students or 2026 Batch
Apply
https://job-boards.greenhouse.io/twilio/jobs/6267229?gh_src=krishankumarlinkedin
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
string solve(string S) {
string protocol, hostname, fileName = "", result = "";
stringstream output;
size_t pos = S.find("://");
if (pos != string::npos) {
protocol = S.substr(0, pos);
}
string rest = S.substr(pos + 3);
pos = rest.find('/');
if (pos != string::npos) {
hostname = rest.substr(0, pos);
rest = rest.substr(pos + 1);
} else {
hostname = rest;
rest = "";
}
output << protocol << endl;
output << hostname << endl;
size_t queryPos = rest.find('?');
if (queryPos != string::npos) {
fileName = rest.substr(0, queryPos);
string query = rest.substr(queryPos + 1);
if (!fileName.empty()) {
output << fileName << endl;
}
output << "Query parameters:" << endl;
stringstream ss(query);
string item;
while (getline(ss, item, '&')) {
size_t equalPos = item.find('=');
if (equalPos != string::npos) {
string key = item.substr(0, equalPos);
string value = item.substr(equalPos + 1);
output << " " << key << ": " << value << endl;
}
}
} else if (!rest.empty()) {
output << rest << endl;
}
result = output.str();
return result;
}
URL Parser โ
Dunhunby
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Solventum hiring Quality Assurance Engineer
0-2 years experience
5-10 LPA CTC
Apply Here : https://healthcare.wd1.myworkdayjobs.com/Search/job/IN-Bangalore-Kar/Software-Quality-Test-Engineer---HIS--Bangalore-_R01109903?source=LinkedIn
0-2 years experience
5-10 LPA CTC
Apply Here : https://healthcare.wd1.myworkdayjobs.com/Search/job/IN-Bangalore-Kar/Software-Quality-Test-Engineer---HIS--Bangalore-_R01109903?source=LinkedIn
Myworkdayjobs
Software Quality Test Engineer - HIS (Bangalore)
Thank you for your interest in working for our Company. Recruiting the right talent is crucial to our goals. On April 1, 2024, 3M Healthcare underwent a corporate spin-off leading to the creation of a new company named Solventum. We are still in the processโฆ
#include <iostream>
#include <cmath>
using namespace std;
long long ss(long long n) {
long long sum = 0;
if (n % 2 == 0) {
sum += 2;
while (n % 2 == 0) {
n /= 2;
}
}
for (long long i = 3; i <= sqrt(n); i += 2) {
if (n % i == 0) {
sum += i;
while (n % i == 0) {
n /= i;
}
}
}
if (n > 1) {
sum += n;
}
return sum;
}
int main() {
long long n;
cin >> n;
cout << ss(n) << endl;
return 0;
}
Sum of prime factors โ
HSBC
SELECT l.id, l.title, l.rating, l.year
FROM library l
JOIN (
SELECT year, MAX(rating) AS max_rating
FROM library
GROUP BY year
) AS year_max
ON l.year = year_max.year AND l.rating = year_max.max_rating
ORDER BY l.year ASC;
Book of the year โ
FROM library l
JOIN (
SELECT year, MAX(rating) AS max_rating
FROM library
GROUP BY year
) AS year_max
ON l.year = year_max.year AND l.rating = year_max.max_rating
ORDER BY l.year ASC;
Book of the year โ
Best Grade โ
Barco (FTE)
Barco (FTE)
long getMaxProfit(vector<int> pnl, int k) {
int n = pnl.size();
long maxprofit = 0;
int i;
long profit = 0;
int start = 0;
for(i=0;i<n;i++) {
profit += pnl[i];
if (profit <= 0) {
profit = 0;
start = i+1;
} else {
maxprofit = max(maxprofit , profit);
if (i-start+1 == k) {
profit -= pnl[start];
start++;
}
while(pnl[start] <= 0 && start <=i) {
profit -= pnl[start];
maxprofit = max(maxprofit , profit);
start++;
}
}
}
return maxprofit;
}
Profit Analysis โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name : Rakuten
Role : Associate Software Engineer
Batch : 2024/2023/2022 passouts
Link : https://symphony-rakuten.sensehq.eu/careers/jobs/41
Role : Associate Software Engineer
Batch : 2024/2023/2022 passouts
Link : https://symphony-rakuten.sensehq.eu/careers/jobs/41
Job openings at Rakuten Symphony
All people need connectivity.The Rakuten Group is reinventing telecom by greatly reducing cost, rewarding big users not penalizing them, empowering more people and leading the human centric AI future.The mission is to connect everybody and enable all to be.Rakuten.โฆ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name : Quizizz
Role : Software Engineer
Batch : 2024/2023/2022 passouts
Link : https://jobs.lever.co/quizizz/ae6fce20-c1d8-4a8e-9b45-c11399f618ec
Role : Software Engineer
Batch : 2024/2023/2022 passouts
Link : https://jobs.lever.co/quizizz/ae6fce20-c1d8-4a8e-9b45-c11399f618ec