vector<string> solve(vector<vector<string>> p, vector<string> a, int w) {
vector<string> r;
r.push_back(string(w + 2, '*'));
for(int i = 0; i < p.size(); i++) {
string l = "";
for(string wd : p[i]) {
if(l.size() + wd.size() + (l.empty() ? 0 : 1) > w) {
if(a[i] == "LEFT") {
l += string(w - l.size(), ' ');
} else if(a[i] == "RIGHT") {
l = string(w - l.size(), ' ') + l;
}
r.push_back("*" + l + "*");
l = "";
}
if(!l.empty()) {
l += " ";
}
l += wd;
}
if(!l.empty()) {
if(a[i] == "LEFT") {
l += string(w - l.size(), ' ');
} else if(a[i] == "RIGHT") {
l = string(w - l.size(), ' ') + l;
}
r.push_back("*" + l + "*");
}
}
r.push_back(string(w + 2, '*'));
return r;
}
Autodesk โ
vector<string> r;
r.push_back(string(w + 2, '*'));
for(int i = 0; i < p.size(); i++) {
string l = "";
for(string wd : p[i]) {
if(l.size() + wd.size() + (l.empty() ? 0 : 1) > w) {
if(a[i] == "LEFT") {
l += string(w - l.size(), ' ');
} else if(a[i] == "RIGHT") {
l = string(w - l.size(), ' ') + l;
}
r.push_back("*" + l + "*");
l = "";
}
if(!l.empty()) {
l += " ";
}
l += wd;
}
if(!l.empty()) {
if(a[i] == "LEFT") {
l += string(w - l.size(), ' ');
} else if(a[i] == "RIGHT") {
l = string(w - l.size(), ' ') + l;
}
r.push_back("*" + l + "*");
}
}
r.push_back(string(w + 2, '*'));
return r;
}
Autodesk โ
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
struct Node{
Node* links[10];
bool end=false;
bool containskey(char ch){
return links[ch-'0']!=NULL;
}
void put(char ch,Node* node){
links[ch-'0']=node;
}
Node* get(char ch){
return links[ch-'0'];
}
void end1(){
end=true;
}
bool isend(){
return end;
}
};
class Trie{
private:
Node* root;
public:
Trie() {
root=new Node();
}
void insert(string word) {
int l=word.size();
Node* node=root;
for(int i=0;i<l;i++)
{
if(!node->containskey(word[i]))
{
node->put(word[i],new Node());
}
node=node->get(word[i]);
}
node->end1();
}
int search(string word) {
int l=word.size();
Node* node=root;
int ans=0;
for(int i=0;i<l;i++)
{
if(!node->containskey(word[i]))
{
return ans;
}
else{
ans++;
}
node=node->get(word[i]);
}
return ans;
}
};
ll solve(vector<ll>a,vector<ll>b){
Trie* t=new Trie;
for(auto x:a){
string s=to_string(x);
t->insert(s);
}
int ans=0;
for(auto x:b){
string s=to_string(x);
ans=max(ans,t->search(s));
}
return ans;
}
Autodesk โ
Node* links[10];
bool end=false;
bool containskey(char ch){
return links[ch-'0']!=NULL;
}
void put(char ch,Node* node){
links[ch-'0']=node;
}
Node* get(char ch){
return links[ch-'0'];
}
void end1(){
end=true;
}
bool isend(){
return end;
}
};
class Trie{
private:
Node* root;
public:
Trie() {
root=new Node();
}
void insert(string word) {
int l=word.size();
Node* node=root;
for(int i=0;i<l;i++)
{
if(!node->containskey(word[i]))
{
node->put(word[i],new Node());
}
node=node->get(word[i]);
}
node->end1();
}
int search(string word) {
int l=word.size();
Node* node=root;
int ans=0;
for(int i=0;i<l;i++)
{
if(!node->containskey(word[i]))
{
return ans;
}
else{
ans++;
}
node=node->get(word[i]);
}
return ans;
}
};
ll solve(vector<ll>a,vector<ll>b){
Trie* t=new Trie;
for(auto x:a){
string s=to_string(x);
t->insert(s);
}
int ans=0;
for(auto x:b){
string s=to_string(x);
ans=max(ans,t->search(s));
}
return ans;
}
Autodesk โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
SDE (Backend) Walk-In Drive-20th Jan,24
https://docs.google.com/forms/d/e/1FAIpQLSezrGonwVTDwu7_wlPTVxIB6V7kKNxYXQ4ZrxajUuHZRg0r0A/viewform
https://docs.google.com/forms/d/e/1FAIpQLSezrGonwVTDwu7_wlPTVxIB6V7kKNxYXQ4ZrxajUuHZRg0r0A/viewform
6/10 test cases pass โ
Autodesk
Autodesk
int solve(int N, int k, vector<int>& d) {
vector<bool> dislike(10, false);
for (int i = 0; i < k; ++i) {
dislike[d[i]] = true;
}
while (true) {
int temp = N;
bool found = false;
while (temp > 0) {
if (dislike[temp % 10]) {
found = true;
break;
}
temp /= 10;
}
if (!found) {
return N;
}
++N;
}
}
Minimum Amount โ
vector<bool> dislike(10, false);
for (int i = 0; i < k; ++i) {
dislike[d[i]] = true;
}
while (true) {
int temp = N;
bool found = false;
while (temp > 0) {
if (dislike[temp % 10]) {
found = true;
break;
}
temp /= 10;
}
if (!found) {
return N;
}
++N;
}
}
Minimum Amount โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐Hybr1d is Hiring !!
Role: Front End Developer
Location: Remote
๐Apply here: https://hybr1dhiring.snaphunt.com/job/8PZP0Z4KBX
Role: Front End Developer
Location: Remote
๐Apply here: https://hybr1dhiring.snaphunt.com/job/8PZP0Z4KBX
Snaphunt
AI powered global recruiting platform & ATS | Snaphunt
Snaphunt is an AI powered global recruiting platform to help employers find, engage and hire talent across geographies in a snap.
string shift(string s) {
string minStr = s;
for(int i=0; i<s.size(); i++) {
s = s.substr(1) + s[0];
if(s < minStr) {
minStr = s;
}
}
return minStr;
}
int solve(vector<int> a) {
map<string, int> m;
for(int i=0; i<a.size(); i++) {
string s = to_string(a[i]);
string minStr = shift(s);
m[minStr]++;
}
int count = 0;
for(auto it=m.begin(); it!=m.end(); it++) {
int n = it->second;
count += (n*(n-1))/2;
}
return count;
}
Autodesk โ
string minStr = s;
for(int i=0; i<s.size(); i++) {
s = s.substr(1) + s[0];
if(s < minStr) {
minStr = s;
}
}
return minStr;
}
int solve(vector<int> a) {
map<string, int> m;
for(int i=0; i<a.size(); i++) {
string s = to_string(a[i]);
string minStr = shift(s);
m[minStr]++;
}
int count = 0;
for(auto it=m.begin(); it!=m.end(); it++) {
int n = it->second;
count += (n*(n-1))/2;
}
return count;
}
Autodesk โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company: Hexagon
Role: Applications Engineer Intern
Expected CTC: 22K (Est)
Batch Eligible: 2022-2024
Website: https://myhr-hexagonmi.my.salesforce-sites.com/recruit/fRecruit__ApplyJob?vacancyNo=VN4383
Role: Applications Engineer Intern
Expected CTC: 22K (Est)
Batch Eligible: 2022-2024
Website: https://myhr-hexagonmi.my.salesforce-sites.com/recruit/fRecruit__ApplyJob?vacancyNo=VN4383
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company: GlobalLogic
Role: Trainee Software Engineer/ Software Engineer
Expected CTC: 8.3 - 12 LPA
Batch Eligible: 2023
Website: https://docs.google.com/forms/d/e/1FAIpQLSdCi5VF6nb-eWvp6aHNhRFZKF232-EyvyaFIl9XHvd0AmSdBg/viewform
Role: Trainee Software Engineer/ Software Engineer
Expected CTC: 8.3 - 12 LPA
Batch Eligible: 2023
Website: https://docs.google.com/forms/d/e/1FAIpQLSdCi5VF6nb-eWvp6aHNhRFZKF232-EyvyaFIl9XHvd0AmSdBg/viewform
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
ServiceNow Women Code to Win 2024 - India by ServiceNow! // Unstop (formerly Dare2Compete)
https://unstop.com/competitions/servicenow-women-code-to-win-2024-india-servicenow-838054
https://unstop.com/competitions/servicenow-women-code-to-win-2024-india-servicenow-838054
Unstop
ServiceNow Women Code to Win 2024 - India - 2023 | 838054 // Unstop
Find out the best ServiceNow Women Code to Win 2024 - India that match your interests. Prove your mettle and win exciting prizes like job opportunities and c... | 2023 | 838054
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company: Sportskeeda
Role: Social Media Intern - WFH
Expected CTC: 3 - 8 LPA
Batch Eligible: Any
Website: https://sportskeeda.zohorecruit.in/jobs/Careers/59509000015968895/Social-Media-Intern-US-Sports
Role: Social Media Intern - WFH
Expected CTC: 3 - 8 LPA
Batch Eligible: Any
Website: https://sportskeeda.zohorecruit.in/jobs/Careers/59509000015968895/Social-Media-Intern-US-Sports
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company: Amazon
Role: Associate Quality Services
Expected CTC: 3.5 to 5.5 LPA
Batch Eligible: Any
Website: https://amazonvirtualhiring.hirepro.in/registration/incta/ju0f4/apply/?j=56434&e=12271
Role: Associate Quality Services
Expected CTC: 3.5 to 5.5 LPA
Batch Eligible: Any
Website: https://amazonvirtualhiring.hirepro.in/registration/incta/ju0f4/apply/?j=56434&e=12271
vector<string> solve(vector<string> s, vector<string> a) {
vector<string> r;
for (auto& song : s) {
string sn;
int sl;
istringstream ss(song);
getline(ss, sn, ':');
ss >> sl;
for (auto& anim : a) {
string an;
int al;
istringstream as(anim);
getline(as, an, '/');
as >> al;
if (sl % al == 0) {
r.push_back(an + ":" + to_string(sl / al));
break;
}
}
}
return r;
}
Tradedesk โ
vector<string> r;
for (auto& song : s) {
string sn;
int sl;
istringstream ss(song);
getline(ss, sn, ':');
ss >> sl;
for (auto& anim : a) {
string an;
int al;
istringstream as(anim);
getline(as, an, '/');
as >> al;
if (sl % al == 0) {
r.push_back(an + ":" + to_string(sl / al));
break;
}
}
}
return r;
}
Tradedesk โ
import java.util.*;
public class Main {
public int solution(int[] A, int X, int Y) {
if (A == null || A.length < 1) return 0;
Arrays.sort(A);
int r = Integer.MAX_VALUE;
for (int i = 0, j = 0, left = 0, right = 0;;) {
for (; j < A.length - i && (left + A[j]) <= right; left += A[j++])
;
r = Math.min(r, X * Math.max(A.length - j - i, 0) + Y * i);
if (++i > A.length) break;
right += A[A.length - i];
}
return r;
}
Tradedesk โ
public class Main {
public int solution(int[] A, int X, int Y) {
if (A == null || A.length < 1) return 0;
Arrays.sort(A);
int r = Integer.MAX_VALUE;
for (int i = 0, j = 0, left = 0, right = 0;;) {
for (; j < A.length - i && (left + A[j]) <= right; left += A[j++])
;
r = Math.min(r, X * Math.max(A.length - j - i, 0) + Y * i);
if (++i > A.length) break;
right += A[A.length - i];
}
return r;
}
Tradedesk โ
Axis Bank Coding Round Done โ