๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
class Solution {
public:
void bfs(vector<vector<int>>&vis,vector<vector<char>>&grid,int i,int j,int n,int m)
{
vis[i][j]=1;
queue<pair<int,int>>q;
q.push({i,j});
while(!q.empty())
{
int row=q.front().first;
int col=q.front().second;
q.pop();
int delrow[4]={1,0,-1,0};
int delcol[4]={0,1,0,-1};
for(int k=0;k<=3;k++){
int nrow=row+delrow[k];
int ncol=col+delcol[k];
if(nrow>=0 and nrow<n and ncol>=0 and ncol<m and grid[nrow][ncol]=='1' and !vis[nrow][ncol])
{
vis[nrow][ncol]=1;
q.push({nrow,ncol});
}
}
}
}
int numIslands(vector<vector<char>>& grid) {
int n=grid.size();
int m=grid[0].size();
vector<vector<int>>vis(n,vector<int>(m,0));
int cnt=0;
for(int i=0;i<n;i++)
{
for(int j=0;j<m;j++)
{
if(!vis[i][j] and grid[i][j]=='1')
{
cnt++;
bfs(vis,grid,i,j,n,m);
}
}
}
return cnt;
}
};
Zeta โ
public:
void bfs(vector<vector<int>>&vis,vector<vector<char>>&grid,int i,int j,int n,int m)
{
vis[i][j]=1;
queue<pair<int,int>>q;
q.push({i,j});
while(!q.empty())
{
int row=q.front().first;
int col=q.front().second;
q.pop();
int delrow[4]={1,0,-1,0};
int delcol[4]={0,1,0,-1};
for(int k=0;k<=3;k++){
int nrow=row+delrow[k];
int ncol=col+delcol[k];
if(nrow>=0 and nrow<n and ncol>=0 and ncol<m and grid[nrow][ncol]=='1' and !vis[nrow][ncol])
{
vis[nrow][ncol]=1;
q.push({nrow,ncol});
}
}
}
}
int numIslands(vector<vector<char>>& grid) {
int n=grid.size();
int m=grid[0].size();
vector<vector<int>>vis(n,vector<int>(m,0));
int cnt=0;
for(int i=0;i<n;i++)
{
for(int j=0;j<m;j++)
{
if(!vis[i][j] and grid[i][j]=='1')
{
cnt++;
bfs(vis,grid,i,j,n,m);
}
}
}
return cnt;
}
};
Zeta โ
๐1
#include <bits/stdc++.h>
using namespace std;
vector<int> solution(vector<int> a, int n, int k) {
vector<int> v;
deque<int> dq;
for (int i = 0; i < n; i++) {
while (!dq.empty() && dq.front() <= i - k)
dq.pop_front();
while (!dq.empty() && a[dq.back()] <= a[i])
dq.pop_back();
dq.push_back(i);
if (i >= k - 1)
v.push_back(a[dq.front()]);
}
return v;
}
int main() {
int n, k;
cin >> n >> k;
vector<int> a(n);
for (int i = 0; i < n; i++)
cin >> a[i];
vector<int> result = solution(a, n, k);
for (int i = 0; i < result.size(); i++)
cout << result[i] << " ";
return 0;
}.
//cricket match โ
Zeta
using namespace std;
vector<int> solution(vector<int> a, int n, int k) {
vector<int> v;
deque<int> dq;
for (int i = 0; i < n; i++) {
while (!dq.empty() && dq.front() <= i - k)
dq.pop_front();
while (!dq.empty() && a[dq.back()] <= a[i])
dq.pop_back();
dq.push_back(i);
if (i >= k - 1)
v.push_back(a[dq.front()]);
}
return v;
}
int main() {
int n, k;
cin >> n >> k;
vector<int> a(n);
for (int i = 0; i < n; i++)
cin >> a[i];
vector<int> result = solution(a, n, k);
for (int i = 0; i < result.size(); i++)
cout << result[i] << " ";
return 0;
}.
//cricket match โ
Zeta
string make_string_S_to_T(string S) {
string T=โprogrammingโ;
bool possible = false;
int M = T.length();
int N = S.length();
for (int i = 0; i <= M; i++) {
int prefix_length = i;
int suffix_length = M - i;
string prefix = S.substr(0, prefix_length);
string suffix = S.substr(N - suffix_length, suffix_length);
if (prefix + suffix == T) {
possible = true;
break;
}
}
if (possible)
return "YES";
else
return "NO";
}
Deleting substring โ
Zeta
string T=โprogrammingโ;
bool possible = false;
int M = T.length();
int N = S.length();
for (int i = 0; i <= M; i++) {
int prefix_length = i;
int suffix_length = M - i;
string prefix = S.substr(0, prefix_length);
string suffix = S.substr(N - suffix_length, suffix_length);
if (prefix + suffix == T) {
possible = true;
break;
}
}
if (possible)
return "YES";
else
return "NO";
}
Deleting substring โ
Zeta
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: Paypal
Role: Software Engineer 1
Batch eligible: 2024 passouts only
Apply: https://paypal.eightfold.ai/careers/job/274895394546
Role: Software Engineer 1
Batch eligible: 2024 passouts only
Apply: https://paypal.eightfold.ai/careers/job/274895394546
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: Beepkart
Role: Frontend Intern
Batch eligible: 2024 and 2025 passouts
Apply: https://docs.google.com/forms/d/e/1FAIpQLSeCsoRzgIG7YTMVIU3DOcx4V0t-M-u5yqsZhEc7QTcIJHQcEA/viewform?usp=send_form
Role: Frontend Intern
Batch eligible: 2024 and 2025 passouts
Apply: https://docs.google.com/forms/d/e/1FAIpQLSeCsoRzgIG7YTMVIU3DOcx4V0t-M-u5yqsZhEc7QTcIJHQcEA/viewform?usp=send_form
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
โ๏ธEmbedUR Systems Off Campus Drive 2024 for Software Engineer | CTC : 8 LPAโ๏ธ
๐จโ๐ป Job Role : Software Engineer
๐Qualification : B.E/ B.Tech
๐ฐSalary : Rs 8 LPA
โญ๏ธ Apply Fast :
https://forms.office.com/pages/responsepage.aspx?id=Z518PquvlEaU4a8oEp7WX2S9iqSidoZKtf3XM9ulYABUME9JQU5VQkdSUUVGUFNBVDVaS05FWE82Ti4u
๐จโ๐ป Job Role : Software Engineer
๐Qualification : B.E/ B.Tech
๐ฐSalary : Rs 8 LPA
โญ๏ธ Apply Fast :
https://forms.office.com/pages/responsepage.aspx?id=Z518PquvlEaU4a8oEp7WX2S9iqSidoZKtf3XM9ulYABUME9JQU5VQkdSUUVGUFNBVDVaS05FWE82Ti4u
Office
Please fill out this form
๐2
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Jai kishan is hiring SDE - Intern
Location : Bangalore
Batch : 2026/2025
Apply Link :
https://www.linkedin.com/jobs/view/3796878798
Location : Bangalore
Batch : 2026/2025
Apply Link :
https://www.linkedin.com/jobs/view/3796878798
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name : Rubrik
Role : SDE Internship - Winter
Stipend : 1.5 Lakh/month
Link to apply : https://www.proelevate.in/job/software-engineering-winter-intern
Role : SDE Internship - Winter
Stipend : 1.5 Lakh/month
Link to apply : https://www.proelevate.in/job/software-engineering-winter-intern
ProElevate
Your one-stop destination for DSA practice, interview experiences, and career opportunities.
๐ฑ2๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Apply, if you're interested!!
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
โ๏ธUnikwork Off Campus Drive 2024 Hiring As iOS Developer | 35K Per Monthโ๏ธ
๐จโ๐ป Job Role : iOS Developer
๐Qualification : B.E/B.Tech/M.E/M.Tech/MCA
๐Experience : Freshers to 2 years
๐ฐSalary : 35K Per Month
โญ๏ธ Apply Fast :
https://unikwork.com/career-details/eyJpdiI6IlZOb2hza2JyQW5SU2NNRmtmVWN0UVE9PSIsInZhbHVlIjoia0JQd2pkaEMwcnhtUjRLeStyZ1lpUT09IiwibWFjIjoiMmFhOWMyZmY1MDNiNGU1MDlhNjhkZDkzMDM3YTc1MWRjMzhkYjFiODFhMmFhM2JmNGE2N2I0ZDIxMTUwZGU2ZSIsInRhZyI6IiJ9
๐จโ๐ป Job Role : iOS Developer
๐Qualification : B.E/B.Tech/M.E/M.Tech/MCA
๐Experience : Freshers to 2 years
๐ฐSalary : 35K Per Month
โญ๏ธ Apply Fast :
https://unikwork.com/career-details/eyJpdiI6IlZOb2hza2JyQW5SU2NNRmtmVWN0UVE9PSIsInZhbHVlIjoia0JQd2pkaEMwcnhtUjRLeStyZ1lpUT09IiwibWFjIjoiMmFhOWMyZmY1MDNiNGU1MDlhNjhkZDkzMDM3YTc1MWRjMzhkYjFiODFhMmFhM2JmNGE2N2I0ZDIxMTUwZGU2ZSIsInRhZyI6IiJ9
Unikwork
Career Details | Unikwork Systems
Our software developers have created dozens of web-based products and mobile apps for numerous companies just like yours, and hereโs how.
package Graph;
import java.util.*;
public class Largest_Sum_Cycle
{
public static int solution(int arr[])
{
ArrayList<Integer>sum=new ArrayList<>();
for(int i=0;i<arr.length;i++)
{
ArrayList<Integer>path=new ArrayList<>();
int j=i;
int t=0;
while(arr[j]<arr.length&&arr[j]!=i&&arr[j]!=-1&&!path.contains(j))
{
path.add(j);
t+=j;
j=arr[j];
if(arr[j]==i)
{
t+=j;
break;
}
}
if(j<arr.length&&i==arr[j])
sum.add(t);
}
if(sum.isEmpty())
return -1;
return Collections.max(sum);
}
public static void main(String[] args)
{
// TODO Auto-generated method stub
Scanner sc=new Scanner(System.in);
int testcases=sc.nextInt();
for(int loop=0;loop<testcases;loop++)
{
int numofBlocks=sc.nextInt();
int arr[]=new int[numofBlocks];
int src,dest;
for(int i=0;i<numofBlocks;i++)
{
arr[i]=sc.nextInt();
}
System.out.println(solution(arr));
}
}
}
Juspay โ
import java.util.*;
public class Largest_Sum_Cycle
{
public static int solution(int arr[])
{
ArrayList<Integer>sum=new ArrayList<>();
for(int i=0;i<arr.length;i++)
{
ArrayList<Integer>path=new ArrayList<>();
int j=i;
int t=0;
while(arr[j]<arr.length&&arr[j]!=i&&arr[j]!=-1&&!path.contains(j))
{
path.add(j);
t+=j;
j=arr[j];
if(arr[j]==i)
{
t+=j;
break;
}
}
if(j<arr.length&&i==arr[j])
sum.add(t);
}
if(sum.isEmpty())
return -1;
return Collections.max(sum);
}
public static void main(String[] args)
{
// TODO Auto-generated method stub
Scanner sc=new Scanner(System.in);
int testcases=sc.nextInt();
for(int loop=0;loop<testcases;loop++)
{
int numofBlocks=sc.nextInt();
int arr[]=new int[numofBlocks];
int src,dest;
for(int i=0;i<numofBlocks;i++)
{
arr[i]=sc.nextInt();
}
System.out.println(solution(arr));
}
}
}
Juspay โ
import java.util.Scanner;
import java.util.*;
public class metting
{
public static void helperFunction()
{
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] edges = new int[n];
for (int i = 0; i < n; i++)
{
edges[i] = sc.nextInt();
}
int C1 = sc.nextInt();
int C2 = sc.nextInt();
// int ans=minimumWeight(n,edges,C1,C2);
// System.out.println(ans);
// public static int minimumWeight(int n, int[] edges, int C1, int C2) {
List<List<Integer>> list = new ArrayList<>();
for (int i = 0; i < n; i++) {
list.add(new ArrayList<Integer>());
}
for (int i = 0; i < n; i++) {
if (edges[i] != -1) {
list.get(i).add(edges[i]);
}
}
long[] array1 = new long[n];
long[] array2 = new long[n];
Arrays.fill(array1, Long.MAX_VALUE);
Arrays.fill(array2, Long.MAX_VALUE);
juspay(C1, list, array1);
juspay(C2, list, array2);
int node = 0;
long dist = Long.MAX_VALUE;
for (int i = 0; i < n; i++) {
if (array1[i] == Long.MAX_VALUE || array2[i] == Long.MAX_VALUE)
continue;
if (dist > array1[i] + array2[i]) {
dist = array1[i] + array2[i];
node = i;
}
}
if (dist == Long.MAX_VALUE)
System.out.print(-1);
//return -1;
// return node;
System.out.print(node);
}
private static void juspay(int start, List<List<Integer>> graph, long[] distances)
{
PriorityQueue<Integer> pq = new PriorityQueue<>();
pq.offer(start);
distances[start] = 0;
while (!pq.isEmpty())
{
int curr = pq.poll();
for (int neighbor : graph.get(curr))
{
long distance = distances[curr] + 1;
if (distance < distances[neighbor])
{
distances[neighbor] = distance;
pq.offer(neighbor);
}
}
}
}
public static void main(String[] args) {
metting m = new metting();
metting.helperFunction();
}
}
Nearest meeting Cell
Juspay โ
import java.util.*;
public class metting
{
public static void helperFunction()
{
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] edges = new int[n];
for (int i = 0; i < n; i++)
{
edges[i] = sc.nextInt();
}
int C1 = sc.nextInt();
int C2 = sc.nextInt();
// int ans=minimumWeight(n,edges,C1,C2);
// System.out.println(ans);
// public static int minimumWeight(int n, int[] edges, int C1, int C2) {
List<List<Integer>> list = new ArrayList<>();
for (int i = 0; i < n; i++) {
list.add(new ArrayList<Integer>());
}
for (int i = 0; i < n; i++) {
if (edges[i] != -1) {
list.get(i).add(edges[i]);
}
}
long[] array1 = new long[n];
long[] array2 = new long[n];
Arrays.fill(array1, Long.MAX_VALUE);
Arrays.fill(array2, Long.MAX_VALUE);
juspay(C1, list, array1);
juspay(C2, list, array2);
int node = 0;
long dist = Long.MAX_VALUE;
for (int i = 0; i < n; i++) {
if (array1[i] == Long.MAX_VALUE || array2[i] == Long.MAX_VALUE)
continue;
if (dist > array1[i] + array2[i]) {
dist = array1[i] + array2[i];
node = i;
}
}
if (dist == Long.MAX_VALUE)
System.out.print(-1);
//return -1;
// return node;
System.out.print(node);
}
private static void juspay(int start, List<List<Integer>> graph, long[] distances)
{
PriorityQueue<Integer> pq = new PriorityQueue<>();
pq.offer(start);
distances[start] = 0;
while (!pq.isEmpty())
{
int curr = pq.poll();
for (int neighbor : graph.get(curr))
{
long distance = distances[curr] + 1;
if (distance < distances[neighbor])
{
distances[neighbor] = distance;
pq.offer(neighbor);
}
}
}
}
public static void main(String[] args) {
metting m = new metting();
metting.helperFunction();
}
}
Nearest meeting Cell
Juspay โ
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
QA Intern at HappyFox
Internship Details:
Full-time Paid Internship
Internship duration: 6 months
Mode of work: Work from office (Guindy, Chennai)
Full time opportunity will be available to interns with good performance
APPLY - https://happyfox.hire.trakstar.com/jobs/fk0xy99
Internship Details:
Full-time Paid Internship
Internship duration: 6 months
Mode of work: Work from office (Guindy, Chennai)
Full time opportunity will be available to interns with good performance
APPLY - https://happyfox.hire.trakstar.com/jobs/fk0xy99
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐Baker Hughes is Hiring !!
Role: Summer Intern
Batch: 2025, 2026, 2027
Expected Stipend: 25k-40k per month
Apply here- https://bit.ly/3S4F7ou
Role: Summer Intern
Batch: 2025, 2026, 2027
Expected Stipend: 25k-40k per month
Apply here- https://bit.ly/3S4F7ou
Unstop
Summer Internship (Engineering/Technology) by Baker Hughes! | 2023 // Unstop (formerly Dare2Compete)
Summer Internship (Engineering/Technology) a jobs by Baker Hughes open to Engineering Students Apply online before 2024-01-22 00:00:00! | 2023