def stemmer(text):
stemmed_text = []
suffixes = ['ed', 'ly', 'ing']
for word in text.split():
if word.endswith(tuple(suffixes)):
word = word[:-2] if word.endswith('ed') else word[:-3]
if len(word) > 8:
word = word[:8]
stemmed_text.append(word)
return ' '.join(stemmed_text)
Suffix stripping stemmer โ
stemmed_text = []
suffixes = ['ed', 'ly', 'ing']
for word in text.split():
if word.endswith(tuple(suffixes)):
word = word[:-2] if word.endswith('ed') else word[:-3]
if len(word) > 8:
word = word[:8]
stemmed_text.append(word)
return ' '.join(stemmed_text)
Suffix stripping stemmer โ
import pandas as pd
def saleorder(df):
grouped = df.groupby(['date added', 'type'])
for (_, group), (_, sold_group) in zip(grouped, grouped):
if group['type'].iloc[0] == 'Received':
received_sizes = group['sizes'].str.split('/').explode().unique()
sold_sizes = sold_group['sizes'].str.split('/').explode().unique()
if all(size in sold_sizes for size in received_sizes):
print("Possible")
else:
print("Not Possible")
Verify Sale Orderโ
๐1
class Message(object):
def init(self, message: str, sender: int, receiver: int) -> None:
self.message = message
self.sender = sender
self.receiver = receiver
def str(self) -> str:
return self.message
def eq(self, other: object) -> bool:
if not isinstance(other, Message):
return False
return self.message == other.message
Message Objects โ
def init(self, message: str, sender: int, receiver: int) -> None:
self.message = message
self.sender = sender
self.receiver = receiver
def str(self) -> str:
return self.message
def eq(self, other: object) -> bool:
if not isinstance(other, Message):
return False
return self.message == other.message
Message Objects โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
UNESCO/Poland Co-Sponsored Fellowships in Engineering 2024 edition
As per the details, It is mentioned that it is only for BSc. and MSc. pursuing but I would recommend other Technical degree holders to apply as well.
Deadline: 10th May
https://www.unesco.org/en/fellowships/poland-engineering
As per the details, It is mentioned that it is only for BSc. and MSc. pursuing but I would recommend other Technical degree holders to apply as well.
Deadline: 10th May
https://www.unesco.org/en/fellowships/poland-engineering
www.unesco.org
UNESCO/Poland Co-Sponsored Fellowships in Engineering 2025 edition
28 fellowships to be co-sponsored by UNESCO and Poland for the 2025 edition
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Cure fit is hiring for a Fresher Business Analyst!
Min experience: 0 years
https://careers.cult.fit/#!/job-view/business-analyst-bangalore-business-analysis-2023081811283322
Min experience: 0 years
https://careers.cult.fit/#!/job-view/business-analyst-bangalore-business-analysis-2023081811283322
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
American Express | SDE | 2025, 2026 Grads
https://www.hackerearth.com/challenges/hackathon/american-express-makeathon-2024/
https://www.hackerearth.com/challenges/hackathon/american-express-makeathon-2024/
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐Plum is hiring for the role of Software Development Engineer I
Experience: 0-1 years
Expected Salary: 10 - 15 LPA
๐Apply here: https://jobs.lever.co/plum/69fbf648-fd31-4894-a92f-a9a45de0efce
Experience: 0-1 years
Expected Salary: 10 - 15 LPA
๐Apply here: https://jobs.lever.co/plum/69fbf648-fd31-4894-a92f-a9a45de0efce
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
def stemmer(text): stemmed_text = [] suffixes = ['ed', 'ly', 'ing'] for word in text.split(): if word.endswith(tuple(suffixes)): word = word[:-2] if word.endswith('ed') else word[:-3] if len(word) > 8: โฆ
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
std::string stemmer(const std::string& text) {
std::stringstream ss(text);
std::string word;
std::vector<std::string> stemmed_words;
while (ss >> word) {
if (word.size() > 2 && (word.substr(word.size() - 2) == "ed"word.substr(word.size() - 2) == "ly" word.substr(word.size() - 3) == "ing")) {
word = word.substr(0, word.size() - 2);
}
if (word.size() > 8) {
word = word.substr(0, 8);
}
stemmed_words.push_back(word);
}
std::string result;
for (const std::string& stemmed_word : stemmed_words) {
result += stemmed_word + " ";
}
result.pop_back();
return result;
}
int main() {
std::string text = "an extremely dangerous dog is barking";
std::cout << stemmer(text) << std::endl; // Output: "an extreme dangerou dog is bark"
return 0;
}
Suffix stripping stemmer โ
#include <sstream>
#include <string>
#include <vector>
std::string stemmer(const std::string& text) {
std::stringstream ss(text);
std::string word;
std::vector<std::string> stemmed_words;
while (ss >> word) {
if (word.size() > 2 && (word.substr(word.size() - 2) == "ed"
word = word.substr(0, word.size() - 2);
}
if (word.size() > 8) {
word = word.substr(0, 8);
}
stemmed_words.push_back(word);
}
std::string result;
for (const std::string& stemmed_word : stemmed_words) {
result += stemmed_word + " ";
}
result.pop_back();
return result;
}
int main() {
std::string text = "an extremely dangerous dog is barking";
std::cout << stemmer(text) << std::endl; // Output: "an extreme dangerou dog is bark"
return 0;
}
Suffix stripping stemmer โ
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
def stabilizeTheSystem(cls, input1): input1= str(input1) return input1.replace('0' , 'S') Stabilize the system โ
def stabilize_system(input1):
s = str(input1)
ans = s.replace('0', '5')
return int(ans)
Stabilize the system โ
s = str(input1)
ans = s.replace('0', '5')
return int(ans)
Stabilize the system โ
#include<bits/stdc++.h>
using namespace std;
const int maxn = 1e6+10;
int n, tr[4*maxn], a[maxn];
void build(int no, int l, int r) {
if(l == r) {
tr[no] = a[l];
return;
}
int lc=2*no,rc=2*no+1,mid=(l+r)/2;
build(lc,l,mid);
build(rc,mid+1,r);
tr[no] = (tr[lc]&tr[rc]);
}
int query(int no, int l, int r, int ll, int rr) {
if(l > rr or r < ll) return ((1<<30)-1);
if(l >= ll && r <= rr) return tr[no];
int lc=2*no,rc=2*no+1,mid=(l+r)/2;
return (query(lc,l,mid,ll,rr)&(query(rc,mid+1,r,ll,rr)));
}
long getZeroBitSubarrays(vector<int> arr) {
n = arr.size();
for(int i = 1; i <= n; i++) {
a[i] = arr[i-1];
}
build(1,1,n);
long ans = 0;
int r = 0;
for(int l = 1; l <= n; l++) {
while(r+1 <= n && query(1,1,n,l,r+1) != 0) {
r++;
}
ans+= n-r;
}
return ans;
}
int main() {
}
DE Shawโ
using namespace std;
const int maxn = 1e6+10;
int n, tr[4*maxn], a[maxn];
void build(int no, int l, int r) {
if(l == r) {
tr[no] = a[l];
return;
}
int lc=2*no,rc=2*no+1,mid=(l+r)/2;
build(lc,l,mid);
build(rc,mid+1,r);
tr[no] = (tr[lc]&tr[rc]);
}
int query(int no, int l, int r, int ll, int rr) {
if(l > rr or r < ll) return ((1<<30)-1);
if(l >= ll && r <= rr) return tr[no];
int lc=2*no,rc=2*no+1,mid=(l+r)/2;
return (query(lc,l,mid,ll,rr)&(query(rc,mid+1,r,ll,rr)));
}
long getZeroBitSubarrays(vector<int> arr) {
n = arr.size();
for(int i = 1; i <= n; i++) {
a[i] = arr[i-1];
}
build(1,1,n);
long ans = 0;
int r = 0;
for(int l = 1; l <= n; l++) {
while(r+1 <= n && query(1,1,n,l,r+1) != 0) {
r++;
}
ans+= n-r;
}
return ans;
}
int main() {
}
DE Shawโ
#include<bits/stdc++.h>
using namespace std;
long getMaxTotalEfficiency(vector<int> compatibility, vector<int> efficiency, int k) {
int n = compatibility.size();
vector<pair<int,int>> a;
for(int i = 0; i < n; i++) {
a.push_back(make_pair(compatibility[i],efficiency[i]));
}
multiset<int> s;
long sum = 0;
sort(a.begin(),a.end(),greater<pair<int,int>>());
long ans = 0;
for(int i = 0; i < n; i++) {
s.insert(a[i].second);
sum+= a[i].second;
while(s.size() > k) {
sum-= *s.begin();
s.erase(s.begin());
}
if(s.size() == k) ans = max(ans,sum*a[i].first);
}
return ans;
}
int main() {
}
DE Shawโ
using namespace std;
long getMaxTotalEfficiency(vector<int> compatibility, vector<int> efficiency, int k) {
int n = compatibility.size();
vector<pair<int,int>> a;
for(int i = 0; i < n; i++) {
a.push_back(make_pair(compatibility[i],efficiency[i]));
}
multiset<int> s;
long sum = 0;
sort(a.begin(),a.end(),greater<pair<int,int>>());
long ans = 0;
for(int i = 0; i < n; i++) {
s.insert(a[i].second);
sum+= a[i].second;
while(s.size() > k) {
sum-= *s.begin();
s.erase(s.begin());
}
if(s.size() == k) ans = max(ans,sum*a[i].first);
}
return ans;
}
int main() {
}
DE Shawโ
long long dfs(int node,vector<vector<int>> &graph,long long &cnt,int k,vector<int> &vis){
long long val=1;
vis[node]=1;
for(auto x : graph[node]){
if(vis[x]==0)
val+=dfs(x,graph,cnt,k,vis);
}
if(node!=1){
cnt+=((val+k-1)/k);
}
return val;
}
long getMinOperations(int k, int n, vector<int> f, vector<int> t) {
vector<vector<int>> graph(n+1);
for(int i=0;i<f.size();i++){
graph[f[i]].push_back(t[i]);
graph[t[i]].push_back(f[i]);
}
long long cnt=0;
vector<int> vis(n+1,0);
dfs(1,graph,cnt,k,vis);
return cnt;
}
DE Shawโ
long long val=1;
vis[node]=1;
for(auto x : graph[node]){
if(vis[x]==0)
val+=dfs(x,graph,cnt,k,vis);
}
if(node!=1){
cnt+=((val+k-1)/k);
}
return val;
}
long getMinOperations(int k, int n, vector<int> f, vector<int> t) {
vector<vector<int>> graph(n+1);
for(int i=0;i<f.size();i++){
graph[f[i]].push_back(t[i]);
graph[t[i]].push_back(f[i]);
}
long long cnt=0;
vector<int> vis(n+1,0);
dfs(1,graph,cnt,k,vis);
return cnt;
}
DE Shawโ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: Flipkart
๐ Job Title: Application Engineer
โ๐ป YOE: 2024 grads only
โก๏ธ Apply: https://docs.google.com/forms/d/e/1FAIpQLScDFW3dArxAtFzohFPsAPNiexs-DFvw8BerpJXwZtj1BVYkHw/viewform
Please do share in your college grps and in case you are applying please react on this post:) ๐โค๏ธ
๐ Job Title: Application Engineer
โ๐ป YOE: 2024 grads only
โก๏ธ Apply: https://docs.google.com/forms/d/e/1FAIpQLScDFW3dArxAtFzohFPsAPNiexs-DFvw8BerpJXwZtj1BVYkHw/viewform
Please do share in your college grps and in case you are applying please react on this post:) ๐โค๏ธ
#include <iostream>
#include <vector>
using namespace std;
int main() {
int N;
cin >> N;
vector<long long> gardens(N);
for (int i = 0; i < N; ++i) {
cin >> gardens[i];
}
long long total_collected = 0;
for (int i = 0; i < N; ++i) {
if (gardens[i] > 10) {
total_collected += gardens[i] - 10;
}
}
cout << total_collected << endl;
return 0;
}
Garden โ
#include <vector>
using namespace std;
int main() {
int N;
cin >> N;
vector<long long> gardens(N);
for (int i = 0; i < N; ++i) {
cin >> gardens[i];
}
long long total_collected = 0;
for (int i = 0; i < N; ++i) {
if (gardens[i] > 10) {
total_collected += gardens[i] - 10;
}
}
cout << total_collected << endl;
return 0;
}
Garden โ