def calculateTotalRegion(heights):
n = len(heights)
left = [-1] * n
right = [n] * n
stack = []
for i in range(n):
while stack and heights[stack[-1]] < heights[i]:
right[stack.pop()] = i
stack.append(i)
stack.clear()
for i in range(n - 1, -1, -1):
while stack and heights[stack[-1]] < heights[i]:
left[stack.pop()] = i
stack.append(i)
total = 0
for i in range(n):
region_length = right[i] - left[i] - 1
total += region_length
return total
LinkedIn โ
long long minimumWeeklyInput(vector<int> costs, int weeks)
{
int n = costs.size();
vector<vector<long long>> dp(n + 1, vector<long long>(weeks + 1, 1e18));
dp[0][0] = 0;
for (int w = 1; w <= weeks; ++w)
{
for (int i = 1; i <= n; ++i)
{
long long max_cost_in_week = 0;
for (int k = i; k > 0; --k)
{
max_cost_in_week = max(max_cost_in_week, (long long)costs[k - 1]);
if (dp[k - 1][w - 1] != 1e18)
{
dp[i][w] = min(dp[i][w], dp[k - 1][w - 1] + max_cost_in_week);
}
}
}
}
return dp[n][weeks];
}
LinkedIn โ
{
int n = costs.size();
vector<vector<long long>> dp(n + 1, vector<long long>(weeks + 1, 1e18));
dp[0][0] = 0;
for (int w = 1; w <= weeks; ++w)
{
for (int i = 1; i <= n; ++i)
{
long long max_cost_in_week = 0;
for (int k = i; k > 0; --k)
{
max_cost_in_week = max(max_cost_in_week, (long long)costs[k - 1]);
if (dp[k - 1][w - 1] != 1e18)
{
dp[i][w] = min(dp[i][w], dp[k - 1][w - 1] + max_cost_in_week);
}
}
}
}
return dp[n][weeks];
}
LinkedIn โ
vector<long> getProcessTime(vector<int> time) {
int n=time.size();
vector<array<long long,2>>dp(n,{LLONG_MIN,LLONG_MIN});
function<long long(int,int)>f=[&](int i, int dff){
if(i==n) return 0LL;
if(dp[i][dff]!=LLONG_MIN){
return dp[i][dff];
}
long long res;
if(dff==0){
res=max(f(i+1,0)-time[i],f(i+1,1)+time[i]);
}
else{
res=min(f(i+1,1)+time[i],f(i+1,0)-time[i]);
}
dp[i][dff]=res;
return res;
};
long long ans=f(0,0);
long long s=accumulate(time.begin(),time.end(),0LL);
return {(s+ans)>>1,(s-ans)>>1};
}
Linkedlnโ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Hiring Alert!
We are looking for interns in Data Analyst, Business Analyst, and Data Scientist roles.
Salary: 3LPA-8LPA + Benefits.
Shift: Day.
Share your CV: hr.mohitkumar01@gmail.com
We are looking for interns in Data Analyst, Business Analyst, and Data Scientist roles.
Salary: 3LPA-8LPA + Benefits.
Shift: Day.
Share your CV: hr.mohitkumar01@gmail.com
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: Microsoft
Role: Software Engineer
Batch eligible: 0-2 years
Apply: https://jobs.careers.microsoft.com/global/en/job/1750058
Role: Software Engineer
Batch eligible: 0-2 years
Apply: https://jobs.careers.microsoft.com/global/en/job/1750058
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: Stripe
Role: Software Engineer
Batch eligible: 2025 grads
Apply: https://stripe.com/jobs/listing/software-engineer-new-grad/6172694?gh_src=73vnei
Role: Software Engineer
Batch eligible: 2025 grads
Apply: https://stripe.com/jobs/listing/software-engineer-new-grad/6172694?gh_src=73vnei
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
string parseURL(const string &url)
{
string ans;
string protocol;
size_t pos = url.find("://");
if (pos != string::npos)
{
protocol = url.substr(0, pos);
ans += protocol;
}
string rest = url.substr(pos + 3);
string hostname;
pos = rest.find('/');
if (pos != string::npos)
{
hostname = rest.substr(0, pos);
ans += " ";
ans += hostname;
rest = rest.substr(pos + 1);
}
else
{
hostname = rest;
ans += " ";
ans += hostname;
rest = "";
}
if (!rest.empty())
{
size_t query_pos = rest.find('=');
string filename;
if (query_pos != string::npos)
{
while (query_pos != string::npos)
{
filename = rest.substr(0, query_pos);
string query = rest.substr(query_pos + 1);
size_t temp = query.find('&');
if (temp == string::npos)
{
ans += " ";
ans += "[";
ans += filename;
ans+=":";
ans+=" ";
ans += query;
ans += ']';
break;
}
string last = query.substr(0, temp);
string last1 = query.substr(temp + 1);
query_pos = last1.find('=');
rest = last1;
ans += " ";
ans += "[";
ans += filename;
ans+=":";
ans+=" ";
ans += last;
ans += ']';
}
}
else
{
ans+=" ";
ans+=rest;
}
}
return ans;
}
URL Parser โ
Dunnhumby
{
string ans;
string protocol;
size_t pos = url.find("://");
if (pos != string::npos)
{
protocol = url.substr(0, pos);
ans += protocol;
}
string rest = url.substr(pos + 3);
string hostname;
pos = rest.find('/');
if (pos != string::npos)
{
hostname = rest.substr(0, pos);
ans += " ";
ans += hostname;
rest = rest.substr(pos + 1);
}
else
{
hostname = rest;
ans += " ";
ans += hostname;
rest = "";
}
if (!rest.empty())
{
size_t query_pos = rest.find('=');
string filename;
if (query_pos != string::npos)
{
while (query_pos != string::npos)
{
filename = rest.substr(0, query_pos);
string query = rest.substr(query_pos + 1);
size_t temp = query.find('&');
if (temp == string::npos)
{
ans += " ";
ans += "[";
ans += filename;
ans+=":";
ans+=" ";
ans += query;
ans += ']';
break;
}
string last = query.substr(0, temp);
string last1 = query.substr(temp + 1);
query_pos = last1.find('=');
rest = last1;
ans += " ";
ans += "[";
ans += filename;
ans+=":";
ans+=" ";
ans += last;
ans += ']';
}
}
else
{
ans+=" ";
ans+=rest;
}
}
return ans;
}
URL Parser โ
Dunnhumby
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
MITSOGO HIRING 2023 & 2024 batch
Job Role: Product Support Engineer
Qualification: B.E/B.Tech , 2024 and 2023 passed out( Any Stream)
Job Location: Chennai (Work from Office)
Shift Details - Rotational shifts (24/5, preferably Night shifts )
CTC - 4 LPA
Apply link : https://forms.office.com/pages/responsepage.aspx?id=KqbnxBjPTUqTeDaRUh_kTkpZb4Wf4idCqyoir4p7sZ5UQlFTR0tEM1dCRVRKSjdYVE5YV0pMWkRJUy4u&route=shorturl
Job Role: Product Support Engineer
Qualification: B.E/B.Tech , 2024 and 2023 passed out( Any Stream)
Job Location: Chennai (Work from Office)
Shift Details - Rotational shifts (24/5, preferably Night shifts )
CTC - 4 LPA
Apply link : https://forms.office.com/pages/responsepage.aspx?id=KqbnxBjPTUqTeDaRUh_kTkpZb4Wf4idCqyoir4p7sZ5UQlFTR0tEM1dCRVRKSjdYVE5YV0pMWkRJUy4u&route=shorturl
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
OIST Japan Internship as mentioned in the reel is now open.
Go and apply OIST Research Internship https://admissions.oist.jp/apply-research-internship
Go and apply OIST Research Internship https://admissions.oist.jp/apply-research-internship
Okinawa Institute of Science and Technology OIST
Admissions
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name : Tekion
Batch : 2023/2022/2021 passouts
Role : Software Engineers
Link : https://docs.google.com/forms/d/e/1FAIpQLScSN6BNb-f7TfzJHulbhpSIoZQEnqOqm_T2oxtx19TiPg2GFA/viewform
Batch : 2023/2022/2021 passouts
Role : Software Engineers
Link : https://docs.google.com/forms/d/e/1FAIpQLScSN6BNb-f7TfzJHulbhpSIoZQEnqOqm_T2oxtx19TiPg2GFA/viewform
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company: Texas Instruments
Batch: 2022/2023/2024
Role: Software Engineer- AI & DL Location: Bangalore.
Skills: C/ C++, Machine learning/Deep Learning
Education: B.Tech/M.Tech
Experience: 0.3 months - 22 months
Interested candidates email your profiles tonamrata.kotur@spectrumconsultants.com
Batch: 2022/2023/2024
Role: Software Engineer- AI & DL Location: Bangalore.
Skills: C/ C++, Machine learning/Deep Learning
Education: B.Tech/M.Tech
Experience: 0.3 months - 22 months
Interested candidates email your profiles to
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
import sys
import threading
class FenwickTree:
def __init__(self, size):
self.n = size + 2
self.tree = [0] * self.n
def update(self, idx):
while idx < self.n:
self.tree[idx] += 1
idx += idx & -idx
def query(self, idx):
res = 0
while idx > 0:
res += self.tree[idx]
idx -= idx & -idx
return res
def main():
sys.setrecursionlimit(1 << 25)
n = int(sys.stdin.readline())
ranges = []
for i in range(n):
x, y = map(int, sys.stdin.readline().split())
ranges.append((x, y, i))
rangesSorted = sorted(ranges, key=lambda x: (x[0], -x[1]))
endPoints = sorted(list(set([y for x, y, _ in rangesSorted])))
yMapping = {y: idx+1 for idx, y in enumerate(endPoints)}
ft = FenwickTree(len(yMapping))
contains = [0] * n
for x, y, idx in rangesSorted:
contains[idx] = ft.query(len(yMapping)) - ft.query(yMapping[y]-1)
ft.update(yMapping[y])
rangesSortedRev = sorted(ranges, key=lambda x: (-x[0], x[1]))
ftRev = FenwickTree(len(yMapping))
containedBy = [0] * n
for x, y, idx in rangesSortedRev:
containedBy[idx] = ftRev.query(yMapping[y])
ftRev.update(yMapping[y])
print(' '.join(map(str, containedBy)))
print(' '.join(map(str, contains)))
threading.Thread(target=main).start()
Kickdrum โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Linkedin
Narendra Singh on LinkedIn: #servicenow #hiring #freshers #careeropportunity #joinus #techjobs | 23 comments
๐ Freshers Hiring Alert! ๐
ServiceNow is thrilled to announce that we are hiring freshers for the IC1 role! ๐
Are you a recent graduate eager to kickstartโฆ | 23 comments on LinkedIn
ServiceNow is thrilled to announce that we are hiring freshers for the IC1 role! ๐
Are you a recent graduate eager to kickstartโฆ | 23 comments on LinkedIn
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company: CRED
Batch: 2025
Role: Web Engg Intern
Reach out to CRED employees for referral
Batch: 2025
Role: Web Engg Intern
Reach out to CRED employees for referral
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Linkedin
Capgemini on LinkedIn: #getthefutureyouwant | 56 comments
Rewrite your future at Capgemini!
We are hiring B.E./B.Tech graduates (2023 and 2024) specializing in Aeronautics or Aerospace to join our team as analysts inโฆ | 56 comments on LinkedIn
We are hiring B.E./B.Tech graduates (2023 and 2024) specializing in Aeronautics or Aerospace to join our team as analysts inโฆ | 56 comments on LinkedIn
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Linkedin
Raja Shekar Vadipilla on LinkedIn: #hiring #fresher #jobs #iit #nit #bits #iiit #rvce #vit #iisc #nsit #psgโฆ | 363 comments
Qualcomm hiring Freshers B.Tech / M.Tech with Computer Science / IT / ECE Stream who are good in C Programming.
2023 and 2024 Passed outs ONLY
Hiring for bothโฆ | 363 comments on LinkedIn
2023 and 2024 Passed outs ONLY
Hiring for bothโฆ | 363 comments on LinkedIn