๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
#include <bits/stdc++.h>
#define ll long long
using namespace std;
struct TrieNode {
unordered_map<ll, TrieNode*> children;
ll count;
TrieNode() : count(0) {}
};
class Trie {
public:
Trie() {
root = new TrieNode();
}
void insert(vector<ll>& vector)
{
TrieNode* node = root;
for (ll num : vector) {
if (node->children.find(num) == node->children.end()) {
node->children[num] = new TrieNode();
}
node = node->children[num];
node->count++;
}
}
ll countPrefix(vector<ll>& prefix) {
TrieNode* node = root;
for (ll num:prefix)
{
if(num==-1) continue;
if (node->children.find(num) == node->children.end()) {
return 0;
}
node = node->children[num];
}
return node->count;
}
private:
TrieNode* root;
};
signed main()
{
ll n,m; cin>>n>>m;
vector<vector<ll>>a(n,vector<ll>(m));
for(ll i=0;i<n;i++)
{
for(ll j=0;j<m;j++) cin>>a[i][j];
}
Trie trie;
for(auto& vector:a) {
trie.insert(vector);
}
ll q; cin>>q;
vector<vector<ll>>qu(q);
for (ll i=0;i<q;i++)
{
ll num;
while(cin>>num && num!=-1)
{
qu[i].push_back(num);
}
}
for(auto&query:qu)
{
cout<<trie.countPrefix(query)<<endl;
}
return 0;
}
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
We're looking for for a full-time intern to work on a computer vision project in the Intelligent Interior team of Mercedes Benz R&D India (MBRDI).
Project duration: 6 months (on-site preferred)
Internship type: Full-time
Topic: 3D computer vision with prior experience in Gaze Estimation and/or Synthetic Data preferred
Minimum Qualification: Pursuing Bachelors/Post-graduation/PhD/Research in relevant disciplines
Preferred Qualification: Pursuing Post-graduation/PhD/Research at top-tier institutes in relevant disciplines
Please drop me an email with a detailed paragraph on your research experience along with your CV at : anuraag.bhattacharya98@gmail.com. DMs might not be entertained.
Background: We at MBRDI are working towards problems in Intelligent Car Interiors. The team is founded on a research mindset and has experience in publishing in some top tier conferences in Computer Vision and Machine learning. We adapt our research into innovative products used for cars.
Project duration: 6 months (on-site preferred)
Internship type: Full-time
Topic: 3D computer vision with prior experience in Gaze Estimation and/or Synthetic Data preferred
Minimum Qualification: Pursuing Bachelors/Post-graduation/PhD/Research in relevant disciplines
Preferred Qualification: Pursuing Post-graduation/PhD/Research at top-tier institutes in relevant disciplines
Please drop me an email with a detailed paragraph on your research experience along with your CV at : anuraag.bhattacharya98@gmail.com. DMs might not be entertained.
Background: We at MBRDI are working towards problems in Intelligent Car Interiors. The team is founded on a research mindset and has experience in publishing in some top tier conferences in Computer Vision and Machine learning. We adapt our research into innovative products used for cars.
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name : Akamai Technologies
Role : Software Engineer
Batch : 2024/2023/2022 passouts
Link : https://akamaicareers.inflightcloud.com/jobdetails/aka_ext/035360?section=aka_ext&job=035360
Role : Software Engineer
Batch : 2024/2023/2022 passouts
Link : https://akamaicareers.inflightcloud.com/jobdetails/aka_ext/035360?section=aka_ext&job=035360
โ๏ธTECH MAHINDRA Interview Exp โ
1) Self Intro.
2) Project.
3) Qns on Project.
4) Which Programming Language
you r Familiar with It.
5) What is Primarykey, Foreignkey.
6) Views in SQL.
7) Syntax of View.
8) Rank.
9) External Table.
10) Method Overloading.
11) Method Overriding.
12) Inheritance.
13) Explain Types of Inheritance
14) Why Multiple Inheritance is not
Supported.
15) Is Multiple Inheritance.
Supported injava and wha is it.
16) Relocation.
17) Night Shifts.
18) Why you Choose TechM.
19) About TechM.
1) Self Intro.
2) Project.
3) Qns on Project.
4) Which Programming Language
you r Familiar with It.
5) What is Primarykey, Foreignkey.
6) Views in SQL.
7) Syntax of View.
8) Rank.
9) External Table.
10) Method Overloading.
11) Method Overriding.
12) Inheritance.
13) Explain Types of Inheritance
14) Why Multiple Inheritance is not
Supported.
15) Is Multiple Inheritance.
Supported injava and wha is it.
16) Relocation.
17) Night Shifts.
18) Why you Choose TechM.
19) About TechM.
Customer purchase Data โ
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
long long minCost(vector<int>& a, vector<int>& b) {
map<int,int>mp;
int n=a.size();
int mini=INT_MAX;
for(int i=0;i<n;i++){
mp[a[i]]++;
mp[b[i]]--;
mini=min(mini,a[i]);
mini=min(mini,b[i]);
}
vector<int>x;
for(auto it:mp){
int t=it.second;
if(t%2==1)return -1;
else{
for(int i=0;i<abs(t)/2;i++){
x.push_back(it.first);
}
}
}
long long ans=0;
int m=x.size();
for(int i=0;i<m/2;i++){
ans+=min(x[i],2*mini);
}
return ans;
}
//rearrange students โ
map<int,int>mp;
int n=a.size();
int mini=INT_MAX;
for(int i=0;i<n;i++){
mp[a[i]]++;
mp[b[i]]--;
mini=min(mini,a[i]);
mini=min(mini,b[i]);
}
vector<int>x;
for(auto it:mp){
int t=it.second;
if(t%2==1)return -1;
else{
for(int i=0;i<abs(t)/2;i++){
x.push_back(it.first);
}
}
}
long long ans=0;
int m=x.size();
for(int i=0;i<m/2;i++){
ans+=min(x[i],2*mini);
}
return ans;
}
//rearrange students โ
def count_subsequences(s1, s2):
m, n = len(s1), len(s2)
dp = [[0] * (n + 1) for _ in range(m + 1)]
for j in range(n + 1):
dp[0][j] = 1
for i in range(1, m + 1):
for j in range(1, n + 1):
if s1[i - 1] == s2[j - 1]:
dp[i][j] = dp[i][j - 1] + dp[i - 1][j - 1]
else:
dp[i][j] = dp[i][j - 1]
return dp[m][n]
//string subsequence
m, n = len(s1), len(s2)
dp = [[0] * (n + 1) for _ in range(m + 1)]
for j in range(n + 1):
dp[0][j] = 1
for i in range(1, m + 1):
for j in range(1, n + 1):
if s1[i - 1] == s2[j - 1]:
dp[i][j] = dp[i][j - 1] + dp[i - 1][j - 1]
else:
dp[i][j] = dp[i][j - 1]
return dp[m][n]
//string subsequence
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
public static int pointsBelong(int x1, int y1, int x2, int y2, int x3, int y3, int xp, int yp, int xq, int yq) {
if (!isValidTriangle(x1, y1, x2, y2, x3, y3)) {
return 0;
}
boolean pBelongs = isPointInTriangle(x1, y1, x2, y2, x3, y3, xp, yp);
boolean qBelongs = isPointInTriangle(x1, y1, x2, y2, x3, y3, xq, yq);
if (pBelongs && qBelongs) {
return 3;
} else if (pBelongs) {
return 1;
} else if (qBelongs) {
return 2;
} else {
return 4;
}
}
private static boolean isValidTriangle(int x1, int y1, int x2, int y2, int x3, int y3) {
double ab = distance(x1, y1, x2, y2);
double bc = distance(x2, y2, x3, y3);
double ac = distance(x1, y1, x3, y3);
return (ab + bc > ac) && (bc + ac > ab) && (ac + ab > bc);
}
private static double distance(int x1, int y1, int x2, int y2) {
return Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
}
private static boolean isPointInTriangle(int x1, int y1, int x2, int y2, int x3, int y3, int xp, int yp) {
double areaABC = triangleArea(x1, y1, x2, y2, x3, y3);
double areaPAB = triangleArea(xp, yp, x1, y1, x2, y2);
double areaPAC = triangleArea(xp, yp, x1, y1, x3, y3);
double areaPBC = triangleArea(xp, yp, x2, y2, x3, y3);
return Math.abs((areaPAB + areaPAC + areaPBC) - areaABC) < 1e-9;
}
private static double triangleArea(int x1, int y1, int x2, int y2, int x3, int y3) {
return Math.abs(x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2)) / 2.0;
}
Do they Belong
Oracle โ
if (!isValidTriangle(x1, y1, x2, y2, x3, y3)) {
return 0;
}
boolean pBelongs = isPointInTriangle(x1, y1, x2, y2, x3, y3, xp, yp);
boolean qBelongs = isPointInTriangle(x1, y1, x2, y2, x3, y3, xq, yq);
if (pBelongs && qBelongs) {
return 3;
} else if (pBelongs) {
return 1;
} else if (qBelongs) {
return 2;
} else {
return 4;
}
}
private static boolean isValidTriangle(int x1, int y1, int x2, int y2, int x3, int y3) {
double ab = distance(x1, y1, x2, y2);
double bc = distance(x2, y2, x3, y3);
double ac = distance(x1, y1, x3, y3);
return (ab + bc > ac) && (bc + ac > ab) && (ac + ab > bc);
}
private static double distance(int x1, int y1, int x2, int y2) {
return Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
}
private static boolean isPointInTriangle(int x1, int y1, int x2, int y2, int x3, int y3, int xp, int yp) {
double areaABC = triangleArea(x1, y1, x2, y2, x3, y3);
double areaPAB = triangleArea(xp, yp, x1, y1, x2, y2);
double areaPAC = triangleArea(xp, yp, x1, y1, x3, y3);
double areaPBC = triangleArea(xp, yp, x2, y2, x3, y3);
return Math.abs((areaPAB + areaPAC + areaPBC) - areaABC) < 1e-9;
}
private static double triangleArea(int x1, int y1, int x2, int y2, int x3, int y3) {
return Math.abs(x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2)) / 2.0;
}
Do they Belong
Oracle โ
๐1
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
vector<int> findMinTeamLengths(int tCount, vector<int>& tList) {
int n = tList.size();
vector<int> res(n, -1);
unordered_map<int, int> tMap;
int dCount = 0;
int l = 0;
for (int r = 0; r < n; r++) {
int curT = tList[r];
if (tMap[curT] == 0) {
dCount++;
}
tMap[curT]++;
while (dCount == tCount) {
res[l] = r - l + 1;
int lT = tList[l];
tMap[lT]--;
if (tMap[lT] == 0) {
dCount--;
}
l++;
}
}
return res;
}
//quiz competition โ
int n = tList.size();
vector<int> res(n, -1);
unordered_map<int, int> tMap;
int dCount = 0;
int l = 0;
for (int r = 0; r < n; r++) {
int curT = tList[r];
if (tMap[curT] == 0) {
dCount++;
}
tMap[curT]++;
while (dCount == tCount) {
res[l] = r - l + 1;
int lT = tList[l];
tMap[lT]--;
if (tMap[lT] == 0) {
dCount--;
}
l++;
}
}
return res;
}
//quiz competition โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: Urban Company
Role: SDE - 1
Batch eligible: 2023 and 2024 grads
Apply: If interested, send your resume to sanjanasupriya.ext@urbancompany.com
Role: SDE - 1
Batch eligible: 2023 and 2024 grads
Apply: If interested, send your resume to sanjanasupriya.ext@urbancompany.com
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Blinkit hiring IOS Intern
Eligibility : Freshers
Location : Gurgaon
Apply Here :
https://docs.google.com/forms/d/e/1FAIpQLSeeSv67P8Mbqr9t8JXaRrTsvxMJ_eCP2qPPmOrM-l_y6lJo8g/viewform
Eligibility : Freshers
Location : Gurgaon
Apply Here :
https://docs.google.com/forms/d/e/1FAIpQLSeeSv67P8Mbqr9t8JXaRrTsvxMJ_eCP2qPPmOrM-l_y6lJo8g/viewform
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
LG is hiring for Research Engineer via Online Challenge
Qualification: B.E./B.Tech
Stream : CS/IT/ISE
Eligibility Criteria: (70% and above or 8.0 CGPA)
Skills: C++ Programming, OOPS, Data Structure and Algorithms, Communication
Passed out: 2023/2024
Backlog: No Backlog
Last date of registration: 6th August 2024
Online Assessment Tentative Date: 8th August 2024
Face-to-Face Interview : LG Soft India, Bangalore
Job Requirements :5
CTC : 7 - 7.5 LPA
Apply Here : https://hiremee.co.in/jobs-list/lg-soft-india-private-limited/software-engineer-69814
Qualification: B.E./B.Tech
Stream : CS/IT/ISE
Eligibility Criteria: (70% and above or 8.0 CGPA)
Skills: C++ Programming, OOPS, Data Structure and Algorithms, Communication
Passed out: 2023/2024
Backlog: No Backlog
Last date of registration: 6th August 2024
Online Assessment Tentative Date: 8th August 2024
Face-to-Face Interview : LG Soft India, Bangalore
Job Requirements :5
CTC : 7 - 7.5 LPA
Apply Here : https://hiremee.co.in/jobs-list/lg-soft-india-private-limited/software-engineer-69814
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Cosma hiring React Intern
Apply Here :
https://apply.hireintel.ai/j/66a7c1b7d3adab3073db1d01?utm_source=li_bhola_post
Apply Here :
https://apply.hireintel.ai/j/66a7c1b7d3adab3073db1d01?utm_source=li_bhola_post
apply.hireintel.ai
Cosma Beauty | React Intern | Job Application Page
This is job application page for React Intern from Cosma Beauty. Upload your resumes and schedule AI interview. Please ensure resume in pdf or word file format.
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Oracle is hiring for Technical Analyst
CTC : 7 - 10 LPA
Batch : 2024/2023/2022 passouts eligible
Apply Here :
https://careers.oracle.com/jobs/#en/sites/jobsearch/job/241626/
CTC : 7 - 10 LPA
Batch : 2024/2023/2022 passouts eligible
Apply Here :
https://careers.oracle.com/jobs/#en/sites/jobsearch/job/241626/
๐1