Oracle MCQ/Code Solution โ
Everyone receive Amazon Dublin OA link?
React ๐ if you received, ๐ if havenโt received!!
React ๐ if you received, ๐ if havenโt received!!
After many messages like above, I have created new channel where will update job opportunities only for experienced candidates. (It will be difficult to manage 2 channel but will try my best).
Here is the link:
https://t.me/codingsamurai
#KeepSharingwithseniors
Here is the link:
https://t.me/codingsamurai
#KeepSharingwithseniors
Telegram
Experience Jobs & Materials
300+ Placement & Competitive Exam Materials
75+ Companies Materials
10+ Weekly Udemy Course Coupons
Daily Off Campus Jobs Updates
India's Biggest Placement Channel!!
โ๐ดโ๐ดโ๐ฉโ๐ปโ๐โ
๐ Share and Support
Buy ads: https://telega.io/c/codingsamurai
75+ Companies Materials
10+ Weekly Udemy Course Coupons
Daily Off Campus Jobs Updates
India's Biggest Placement Channel!!
โ๐ดโ๐ดโ๐ฉโ๐ปโ๐โ
๐ Share and Support
Buy ads: https://telega.io/c/codingsamurai
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ pinned ยซAfter many messages like above, I have created new channel where will update job opportunities only for experienced candidates. (It will be difficult to manage 2 channel but will try my best). Here is the link: https://t.me/codingsamurai #KeepSharingwithseniorsยป
def check_similar_passwords(new_passwords, old_passwords):
ans = []
for new_pass, old_pass in zip(new_passwords, old_passwords):
i, j = 0, 0
while i < len(new_pass) and j < len(old_pass):
new_char = new_pass[i]
old_char = old_pass[j]
new_shifted_char = 'a' if new_char == 'z' else chr(ord(new_char) + 1)
if old_char == new_char or old_char == new_shifted_char:
j += 1
i += 1
ans.append("YES" if j == len(old_pass) else "NO")
return ans
new_passwords = ["aaccbbee", "aab"]
old_passwords = ["bdbf", "aee"]
print(check_similar_passwords(new_passwords, old_passwords))
Python 3โ
(Amazon)
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: BarRaiser
Role: Backend Intern
Batch eligible: 2024 and 2025 grads
Duration: 6 months
Apply: https://www.linkedin.com/jobs/view/3688872459
Role: Backend Intern
Batch eligible: 2024 and 2025 grads
Duration: 6 months
Apply: https://www.linkedin.com/jobs/view/3688872459
Linkedin
7,000+ Intern jobs in India (301 new)
Todayโs top 7,000+ Intern jobs in India. Leverage your professional network, and get hired. New Intern jobs added daily.
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Zypp Electric Hiring This Position
1. Business Head - Expansion
2. Data/AI/ML Strategy/Product Head
3. Engineering Lead
4. Data Scientist
5. Battery and Motor specialist
https://docs.google.com/forms/d/e/1FAIpQLSfynJaXx3tcjdKsxTOtzzsXaV4Arn397OdQEOU6TjBbCjLYng/viewform
1. Business Head - Expansion
2. Data/AI/ML Strategy/Product Head
3. Engineering Lead
4. Data Scientist
5. Battery and Motor specialist
https://docs.google.com/forms/d/e/1FAIpQLSfynJaXx3tcjdKsxTOtzzsXaV4Arn397OdQEOU6TjBbCjLYng/viewform
#include <bits/stdc++.h>
using namespace std;
int getMaxCount(vector<int>people,vector<char>status){
int i=0;
int ans=0;
map<int,int>mp;
int n=status.size();
for(int i=0;i<n;i++){
int bro=people[i];
if(status[i]=='-'){
mp[bro]--;
if(mp[bro]==0){
mp.erase(bro);
}
}else{
mp[bro]++;
}
int helo=mp.size();
ans=max(ans,helo);
}
return ans;
}
int main() {
int n;
cin>>n;
vector<int>vec(n);
vector<char>vec2(n);
for(int i=0;i<n;i++){
cin>>vec[i];
}
for(int i=0;i<n;i++){
cin>>vec2[i];
}
cout<<getMaxCount(vec,vec2);
return 0;
}
Amazon Dublin โ
using namespace std;
int getMaxCount(vector<int>people,vector<char>status){
int i=0;
int ans=0;
map<int,int>mp;
int n=status.size();
for(int i=0;i<n;i++){
int bro=people[i];
if(status[i]=='-'){
mp[bro]--;
if(mp[bro]==0){
mp.erase(bro);
}
}else{
mp[bro]++;
}
int helo=mp.size();
ans=max(ans,helo);
}
return ans;
}
int main() {
int n;
cin>>n;
vector<int>vec(n);
vector<char>vec2(n);
for(int i=0;i<n;i++){
cin>>vec[i];
}
for(int i=0;i<n;i++){
cin>>vec2[i];
}
cout<<getMaxCount(vec,vec2);
return 0;
}
Amazon Dublin โ
long ans = 0;
for (int i = 0; i < arr.size(); i++)
{
map<int, int> m;
for (int j = i; j < arr.size(); j++)
{
m[arr[j]]++;
}
ans += m.size();
}
return ans;
Amazon Dublin OAโ
for (int i = 0; i < arr.size(); i++)
{
map<int, int> m;
for (int j = i; j < arr.size(); j++)
{
m[arr[j]]++;
}
ans += m.size();
}
return ans;
Amazon Dublin OAโ
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
bool isBalanced(const string& s) {
int balance = 0;
for (char c : s) {
if (c == '[') {
balance++;
} else if (c == ']') {
balance--;
}
}
return balance == 0;
}
string generateRegex(const string& a, const string& b, const string& c) {
int maxLength = a.size() + b.size() + 4; // 4 accounts for potential "[...]" brackets
string longestRegex;
for (int len = maxLength; len >= 0; len--) {
for (int i = 0; i < a.size(); i++) {
for (int j = 0; j < b.size(); j++) {
if (i + len > a.size() || j + len > b.size()) {
continue;
}
string substrA = a.substr(i, len);
string substrB = b.substr(j, len);
if (isBalanced(substrA) && isBalanced(substrB)) {
string regex = "[" + substrA + substrB + "]";
if (regex.find(c) == string::npos && regex.size() > longestRegex.size()) {
longestRegex = regex;
}
}
}
}
}
return longestRegex;
}
int main() {
string a = "DABCIBC";
string b = "ABCA";
string c = "BBCA";
string longestRegex = generateRegex(a, b, c);
cout << longestRegex << endl;
return 0;
}
Amazon Dublin โ
#include <vector>
#include <algorithm>
using namespace std;
bool isBalanced(const string& s) {
int balance = 0;
for (char c : s) {
if (c == '[') {
balance++;
} else if (c == ']') {
balance--;
}
}
return balance == 0;
}
string generateRegex(const string& a, const string& b, const string& c) {
int maxLength = a.size() + b.size() + 4; // 4 accounts for potential "[...]" brackets
string longestRegex;
for (int len = maxLength; len >= 0; len--) {
for (int i = 0; i < a.size(); i++) {
for (int j = 0; j < b.size(); j++) {
if (i + len > a.size() || j + len > b.size()) {
continue;
}
string substrA = a.substr(i, len);
string substrB = b.substr(j, len);
if (isBalanced(substrA) && isBalanced(substrB)) {
string regex = "[" + substrA + substrB + "]";
if (regex.find(c) == string::npos && regex.size() > longestRegex.size()) {
longestRegex = regex;
}
}
}
}
}
return longestRegex;
}
int main() {
string a = "DABCIBC";
string b = "ABCA";
string c = "BBCA";
string longestRegex = generateRegex(a, b, c);
cout << longestRegex << endl;
return 0;
}
Amazon Dublin โ