๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.62K subscribers
5.61K photos
3 videos
95 files
10.6K links
๐ŸšฉMain Group - @SuperExams
๐Ÿ“Job Updates - @FresherEarth

๐Ÿ”ฐAuthentic Coding Solutions(with Outputs)
โš ๏ธDaily Job Updates
โš ๏ธHackathon Updates & Solutions

Buy ads: https://telega.io/c/cs_algo
Download Telegram
class Solution {
private:
bool isvalidMatching(string & word, string & pattern) {
unordered_map<char,char>mpp;
unordered_set<char>lookup;
for(int i=0;i<word.size();i++){
if(mpp.find(word[i])!=mpp.end()){
if(mpp[word[i]]!=pattern[i]) return false;
}else{
if(lookup.count(pattern[i])) return false;
mpp[word[i]]=pattern[i];
lookup.insert(pattern[i]);
}
}
return true;


}
public:
vector<string> findAndReplacePattern(vector<string>& words, string pattern) {
vector<string>ans;
for(auto &word:words){
if(isvalidMatching(word,pattern)){
ans.push_back(word);
}
}
return ans;
}
};

Find and Replace Pattern โœ…
(C++)
๐Ÿ‘1
Dear All,

We have openings for B. Tech / M. Tech and MCA candidates on the following profile at upGrad:

*Position* - Technical Trainer & Mentor

*Skill Set* - JAVA, Data Structures, HTML, CSS & JavaScript,React-JS, MVC, SpringBoot, Rest APIs, JAVA, Data Structures, HTML & CSS, Basics of JavaScript

*Location* - Punjab

*JD* - https://bit.ly/3PYrkvZ

Interested Candidate please contact on details mentioned below or send your resume on supply@upgrad.com

Mr. Shamneesh Sharma - Program Manager - upGrad - +91 86793 34000 - shamneesh.sharma@upgrad.com
Mr. Chetan Sharma - Program Manager - upGrad - +91 7018443448 - chetan2.sharma@upgrad.com
๐Ÿ‘1
// Word Subset
class Solution:
def wordSubsets(self, words1: List[str], words2: List[str]) -> List[str]:
ans = set(words1)
letters = {}
for i in words2:
for j in i:
count = i.count(j)
if j not in letters or count > letters[j]:
letters[j] = count
for i in words1:
for j in letters:
if i.count(j) < letters[j]:
ans.remove(i)
break
return list(ans)

Python 3โœ…
๐Ÿ‘2