๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
#include <cctype> // For std::tolower
using namespace std;
const int ALPHABET_SIZE = 26;
struct TrieNode {
struct TrieNode* children[ALPHABET_SIZE];
bool isEndOfWord;
TrieNode() {
isEndOfWord = false;
for (int i = 0; i < ALPHABET_SIZE; i++) {
children[i] = nullptr;
}
}
~TrieNode() {
for (int i = 0; i < ALPHABET_SIZE; i++) {
delete children[i];
}
}
};
void insertWord(TrieNode* root, const string& word) {
TrieNode* current = root;
for (char c : word) {
// Convert character to lowercase before processing
c = tolower(c);
// Only process lowercase letters
if (c >= 'a' && c <= 'z') {
int index = c - 'a';
if (!current->children[index]) {
current->children[index] = new TrieNode();
}
current = current->children[index];
}
}
current->isEndOfWord = true;
}
void collectWords(TrieNode* node, string currentWord, vector<string>& result) {
if (node->isEndOfWord) {
result.push_back(currentWord);
}
for (int i = 0; i < ALPHABET_SIZE; i++) {
if (node->children[i]) {
collectWords(node->children[i], currentWord + char('a' + i), result);
}
}
}
vector<string> solution(const string& words) {
TrieNode* root = new TrieNode();
istringstream iss(words);
string word;
while (iss >> word) {
insertWord(root, word);
}
vector<string> result;
collectWords(root, "", result);
sort(result.begin(), result.end(),
[](const string& a, const string& b) {
if (a.length() != b.length()) {
return a.length() < b.length();
}
return a < b;
});
delete root;
return result;
}
int main() {
string input = "Hello world, this is a Trie example!";
vector<string> words = solution(input);
for (const string& word : words) {
cout << word << endl;
}
return 0;
}
Cohesity โ
from collections import Counter
def solve(a):
b = Counter(a)
c = []
d = ''
for e in sorted(b.keys()):
f = b[e]
if f % 2 == 1:
if not d:
d = e
f -= 1
c.append(e * (f // 2))
g = ''.join(c)
return g + d + g[::-1]
h = int(input().strip())
i = []
for _ in range(h):
j = input().strip()
i.append(solve(j))
print("\n".join(i))
MAQ Software โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company: GXS Bank
Role: Software Engineering Internship
Batch: 2025, 2026, 2027
https://www.linkedin.com/jobs/view/4071854518
Role: Software Engineering Internship
Batch: 2025, 2026, 2027
https://www.linkedin.com/jobs/view/4071854518
Linkedin
GXS Bank hiring Software Engineering Internship in Bengaluru, Karnataka, India | LinkedIn
Posted 2:14:41 AM. About usGRXST Software Services Pvt Ltd, part of the esteemed GXS Bank Pte Ltd group of companiesโฆSee this and similar jobs on LinkedIn.
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company : SupraOracles
Program: Career Academy
Batch: 2027
Rewards: Mentorship + Skills + Interview Opportunity at Paypal
https://boards.greenhouse.io/supraoracles/jobs/5191557004
Program: Career Academy
Batch: 2027
Rewards: Mentorship + Skills + Interview Opportunity at Paypal
https://boards.greenhouse.io/supraoracles/jobs/5191557004
boards.greenhouse.io
Research Internship (Blockchain Storage)
Remote
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company: SuperKalam (YC W23)
Role: Backend Engineer (Internship)
Stipend: โน30K - โน47K INR
Location: Bengaluru, KA, IN / Remote (Bengaluru, KA, IN)
https://www.ycombinator.com/companies/superkalam/jobs/rxajsHH-backend-engineer-internship
Role: Backend Engineer (Internship)
Stipend: โน30K - โน47K INR
Location: Bengaluru, KA, IN / Remote (Bengaluru, KA, IN)
https://www.ycombinator.com/companies/superkalam/jobs/rxajsHH-backend-engineer-internship
Y Combinator
Backend Engineer (Internship) at SuperKalam
This is a position for a super pumped intern who has good engineering fundamentals and wants to work on diverse projects (personalisation, recommendation, scale, etc) in a fast-pace environment\
\
**Application form:** <https://forms.gle/RV48eArCpe8p6P3SA>โฆ
\
**Application form:** <https://forms.gle/RV48eArCpe8p6P3SA>โฆ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company : Paypal
Program: Career Academy
Batch: 2027
Rewards: Mentorship + Skills + Interview Opportunity at PayPal
http://paypal.eightfold.ai/events/candidate/landing?plannedEventId=OYoXKVoK&source=KrishanKumarLinkedin
Program: Career Academy
Batch: 2027
Rewards: Mentorship + Skills + Interview Opportunity at PayPal
http://paypal.eightfold.ai/events/candidate/landing?plannedEventId=OYoXKVoK&source=KrishanKumarLinkedin
paypal.eightfold.ai
Career Academy
The Career Academy is a curated educational program designed to enable First Generation students entering their second year at University to prepare for a future career in tech. Students will learn valuable skills in interviewing, networking, professionalโฆ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
job-boards.greenhouse.io
66degrees
<p>Shaping the Future of Work with Cloud, Data and AI
At 66degrees, we help companies unlock value by transforming Customer Experiences and Business Operations through innovative Cloud, Data and AI solutions.
Success is Predictable.</p>
At 66degrees, we help companies unlock value by transforming Customer Experiences and Business Operations through innovative Cloud, Data and AI solutions.
Success is Predictable.</p>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
vector<int> computeLPSArray(const string& str) {
int n = str.length();
vector<int> lps(n, 0);
int len = 0;
int i = 1;
while (i < n) {
if (str[i] == str[len]) {
len++;
lps[i] = len;
i++;
}
else {
if (len != 0) {
len = lps[len - 1];
}
else {
lps[i] = 0;
i++;
}
}
}
return lps;
}
int solution(string& S) {
int n = S.length();
if (n <= 1) return 0;
vector<int> lps = computeLPSArray(S);
return lps[n-1] < n ? lps[n-1] : lps[lps[n-1]-1];
}
Task1
Amex โ
๐2
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int solution(string &S) {
int N = S.length();
long long operations = 0;
int start = 0;
while (start < N && S[start] == '0') {
start++;
}
if (start == N) return 0;
for (int i = start; i < N; i++) {
if (S[i] == '1') {
operations += 2;
} else {
operations += 1;
}
}
operations--;
return operations;
}
Task2
Amexโ
int solution(vector<int> &A)
{
int n = A.size();
int res = 0;
multiset<int>st;
map<int, int>mp;
for (int i = 0; i < n; i++)
{
mp[A[i]]++;
st.insert(i);
while (mp.size() > 2) {
auto cur = *st.begin();
st.erase(cur);
mp[A[cur]]--;
if (mp[A[cur]] == 0) {
mp.erase(A[cur]);
}
}
res = max(res, (int)(st.size()));
}
return res;
}
Task3
Amex โ
import heapq
def solve(a, b, c):
d = [(x, x) for x in b]
heapq.heapify(d)
for _ in range(c):
e, f = heapq.heappop(d)
e += f
heapq.heappush(d, (e, f))
return max(e for e, _ in d)
t = int(input())
results = []
for _ in range(t):
a = int(input())
b = list(map(int, input().split()))
c = int(input())
results.append(solve(a, b, c))
for res in results:
print(res)
Vehant Technology โ
#include <bits/stdc++.h>
using namespace std;
long getDataDependenceSum(long n) {
set<long> dependentDays;
for (long k = 1; k * k <= n; ++k) {
dependentDays.insert(n / k);
dependentDays.insert(k);
}
long sum = 0;
for (auto day : dependentDays) {
sum += day;
}
return sum;
}
Amazon โ
using namespace std;
long getDataDependenceSum(long n) {
set<long> dependentDays;
for (long k = 1; k * k <= n; ++k) {
dependentDays.insert(n / k);
dependentDays.insert(k);
}
long sum = 0;
for (auto day : dependentDays) {
sum += day;
}
return sum;
}
Amazon โ
#include <ibits/stdc++.h>
using namespace std;
int count(int num, int p) {
int count = 0;
while (num % p == 0 && num > 0) {
count++;
num /= p;
}
return count;
}
int solve(int n, vector<vector<int>>& v) {
vector<vector<int>> dp2(n, vector<int>(n, INT_MAX));
vector<vector<int>> dp5(n, vector<int>(n, INT_MAX));
dp2[0][0] = count(v[0][0], 2);
dp5[0][0] = count(v[0][0], 5);
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
if (i > 0) {
dp2[i][j] = min(dp2[i][j], dp2[i - 1][j] + count(v[i][j], 2));
dp5[i][j] = min(dp5[i][j], dp5[i - 1][j] + count(v[i][j], 5));
}
if (j > 0) {
dp2[i][j] = min(dp2[i][j], dp2[i][j - 1] + count(v[i][j], 2));
dp5[i][j] = min(dp5[i][j], dp5[i][j - 1] + count(v[i][j], 5));
}
}
}
return min(dp2[n - 1][n - 1], dp5[n - 1][n - 1]);
}
Treasure Room โ
Netcore
Google has started releasing Internship Offers
For the openings shared in the previous months.
How many of you have received it?
For the openings shared in the previous months.
How many of you have received it?
๐คฉ1