vector<int>findSubsequence(vector<int>arr) {
map<int, vector<int>> ind;
for (int i = 0; i < arr.size(); ++i) {
ind[arr[i]].push_back(i);
}
vector<int> res;
res.push_back(-1);
for (auto &[_, v] : ind) {
if (v.size() <= 1) continue;
int cnt = 0;
for (auto it : v) {
if (res.back() > it) continue;
cnt++;
res.push_back(it);
if (cnt == v.size() - 1) break;
}
if (cnt < v.size() - 1) {
return { -1 };
}
}
vector<int> fres;
for (int i = 1; i < res.size(); ++i) {
fres.push_back(arr[res[i]]);
}
return fres;
}
findSubsequence
Lindkdin all passed
โ
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
vector<int>findSubsequence(vector<int>arr) { map<int, vector<int>> ind; for (int i = 0; i < arr.size(); ++i) { ind[arr[i]].push_back(i); } vector<int> res; res.push_back(-1); for (auto &[_, v] : ind) { if (v.size()โฆ
โ
import java.util.*;
public class AnagramSubsequenceFinder {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String S = sc.nextLine();
int N = sc.nextInt();
sc.nextLine();
String[] W = new String[N];
for (int i = 0; i < N; i++) {
W[i] = sc.nextLine();
}
int[] freqS = getFrequency(S);
int count = 0;
for (String w : W) {
if (isValidAnagramSubsequence(freqS, w)) {
count++;
}
}
System.out.println(count);
}
private static int[] getFrequency(String S) {
int[] freq = new int[26];
for (char c : S.toCharArray()) {
freq[c - 'a']++;
}
return freq;
}
private static boolean isValidAnagramSubsequence(int[] freqS, String w) {
int[] freqW = new int[26];
for (char c : w.toCharArray()) {
freqW[c - 'a']++;
}
for (int i = 0; i < 26; i++) {
if (freqW[i] > freqS[i]) {
return false;
}
}
return true;
}
}
// Minimal substring length
public class AnagramSubsequenceFinder {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String S = sc.nextLine();
int N = sc.nextInt();
sc.nextLine();
String[] W = new String[N];
for (int i = 0; i < N; i++) {
W[i] = sc.nextLine();
}
int[] freqS = getFrequency(S);
int count = 0;
for (String w : W) {
if (isValidAnagramSubsequence(freqS, w)) {
count++;
}
}
System.out.println(count);
}
private static int[] getFrequency(String S) {
int[] freq = new int[26];
for (char c : S.toCharArray()) {
freq[c - 'a']++;
}
return freq;
}
private static boolean isValidAnagramSubsequence(int[] freqS, String w) {
int[] freqW = new int[26];
for (char c : w.toCharArray()) {
freqW[c - 'a']++;
}
for (int i = 0; i < 26; i++) {
if (freqW[i] > freqS[i]) {
return false;
}
}
return true;
}
}
// Minimal substring length
Upstox is hiring for different roles.
SDE 1 (Backend), SDE 1 (iOS), SDE 2 (Frontend) and UI/UX Intern
Fill the form if eligible and interested: https://docs.google.com/forms/d/e/1FAIpQLSdd0jPiasglYGikjSOrlc1KkbcIYp3S5VAx005OifzBNS44ow/viewform
SDE 1 (Backend), SDE 1 (iOS), SDE 2 (Frontend) and UI/UX Intern
Fill the form if eligible and interested: https://docs.google.com/forms/d/e/1FAIpQLSdd0jPiasglYGikjSOrlc1KkbcIYp3S5VAx005OifzBNS44ow/viewform
def minimumSquads(parents):
n = len(parents)
depth = [-1] * n
def calculate_depth(node):
if depth[node] != -1:
return depth[node]
if parents[node] == -1:
depth[node] = 0
else:
depth[node] = calculate_depth(parents[node]) + 1
return depth[node]
max_depth = 0
for i in range(n):
max_depth = max(max_depth, calculate_depth(i))
return max_depth + 1
Minimum squads โ
n = len(parents)
depth = [-1] * n
def calculate_depth(node):
if depth[node] != -1:
return depth[node]
if parents[node] == -1:
depth[node] = 0
else:
depth[node] = calculate_depth(parents[node]) + 1
return depth[node]
max_depth = 0
for i in range(n):
max_depth = max(max_depth, calculate_depth(i))
return max_depth + 1
Minimum squads โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name : Goldman Sachs
Role : Graduate Role (multiple roles)
Batch : 2026 passouts(non-engineering)
Link. : https://www.goldmansachs.com/careers/students/programs/india/graduate-campus-hiring-program.html
Last date to register is July 14.
Role : Graduate Role (multiple roles)
Batch : 2026 passouts(non-engineering)
Link. : https://www.goldmansachs.com/careers/students/programs/india/graduate-campus-hiring-program.html
Last date to register is July 14.
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Microsoft Hiring Software Engineer Intern
Batch : 2026
https://jobs.careers.microsoft.com/us/en/job/1735688/Software-Engineering-Intern
Batch : 2026
https://jobs.careers.microsoft.com/us/en/job/1735688/Software-Engineering-Intern
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Softwaysolutions is hiring for UI Developer - Remote
Expected Salary: 4-10 LPA
Apply here:
https://softwaysolutions.freshteam.com/jobs/eJZzvJujN45l/ui-developer-contractor-remote
Expected Salary: 4-10 LPA
Apply here:
https://softwaysolutions.freshteam.com/jobs/eJZzvJujN45l/ui-developer-contractor-remote
Freshteam
Hiring for UI Developer (Contractor) (Remote) - Associate
Posted by : Softway | javascript,HTML,CSS,Framer motion,GSAP,anime.js,Lottie,JEST FRAMEWORK,GRAPHQL,REST API,WEBPACK,Babel,CSS animation
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐AskmeOffers.com is hiring for Multiple Roles - Remote
Expected Salary: 15-25 LPA
Apply here for Software Engineer:
https://linkedin.com/jobs/view/3965806700/
Apply here for Quality Assurance Engineer:
https://linkedin.com/jobs/view/3965847630/
Expected Salary: 15-25 LPA
Apply here for Software Engineer:
https://linkedin.com/jobs/view/3965806700/
Apply here for Quality Assurance Engineer:
https://linkedin.com/jobs/view/3965847630/
Linkedin
AskmeOffers.com hiring Software Engineer in India | LinkedIn
Posted 4:54:18 PM. Company Description At AskMeOffers, our mission is to revolutionize the online shopping experienceโฆSee this and similar jobs on LinkedIn.
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company โ IIDE Education Private Limited
Role โ Data Analyst Internship
Exp. โ Fresher
Apply Here โ https://internshala.com/internship/detail/data-analyst-internship-in-mumbai-at-iide-education-private-limited1720264879?utm_source=cp_link&referral=web_share
Company โ Blackcoffer
Role โ Data Science Internship
Exp. โ Fresher
Apply Here โ https://internshala.com/internship/details/work-from-home-data-science-internship-at-blackcoffer1720199867?utm_source=cp_link&referral=web_share
Company โ AskmeOffers.com
Role โ Data Analyst
Exp. โ Fresher
Apply Here โ https://www.linkedin.com/jobs/view/3965852124
Company โ White Gold Bullion Private Limited
Role โ Mis Executive
Exp. โ 0-3 yrs
Apply Here โ https://www.foundit.in/job/mis-executive-white-gold-bullion-private-limited-bengaluru-bangalore-31074671?searchId=b0b11ba6-607b-4d50-91c9-b823e3ce49dd
Company โ Blockchain for the Next Billion
Role โ Data Analyst
Exp. โ 0-5 yrs
Apply Here โ https://www.linkedin.com/jobs/view/3966385446
Role โ Data Analyst Internship
Exp. โ Fresher
Apply Here โ https://internshala.com/internship/detail/data-analyst-internship-in-mumbai-at-iide-education-private-limited1720264879?utm_source=cp_link&referral=web_share
Company โ Blackcoffer
Role โ Data Science Internship
Exp. โ Fresher
Apply Here โ https://internshala.com/internship/details/work-from-home-data-science-internship-at-blackcoffer1720199867?utm_source=cp_link&referral=web_share
Company โ AskmeOffers.com
Role โ Data Analyst
Exp. โ Fresher
Apply Here โ https://www.linkedin.com/jobs/view/3965852124
Company โ White Gold Bullion Private Limited
Role โ Mis Executive
Exp. โ 0-3 yrs
Apply Here โ https://www.foundit.in/job/mis-executive-white-gold-bullion-private-limited-bengaluru-bangalore-31074671?searchId=b0b11ba6-607b-4d50-91c9-b823e3ce49dd
Company โ Blockchain for the Next Billion
Role โ Data Analyst
Exp. โ 0-5 yrs
Apply Here โ https://www.linkedin.com/jobs/view/3966385446
Internshala
Data Analyst Internship in Mumbai at IIDE Education Private Limited
Selected intern's day-to-day responsibilities include:
1. Integrate new technologies into the business.
2. Report using Google Data Studio, Google Sheets, and Excel.
3. Monitor and manage our learning management system.
4. Utilize software suchโฆ
1. Integrate new technologies into the business.
2. Report using Google Data Studio, Google Sheets, and Excel.
3. Monitor and manage our learning management system.
4. Utilize software suchโฆ