๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
import java.util.*;
public class MaxBinaryPath {
static int N;
static String S;
static List<Integer>[] adj;
static boolean[] visited;
static String maxBinary = "";
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
N = sc.nextInt();
S = sc.next();
adj = new ArrayList[N + 1];
for (int i = 1; i <= N; i++) {
adj[i] = new ArrayList<>();
}
for (int i = 0; i < N - 1; i++) {
int u = sc.nextInt();
int v = sc.nextInt();
adj[u].add(v);
adj[v].add(u);
}
visited = new boolean[N + 1];
for (int i = 1; i <= N; i++) {
Arrays.fill(visited, false);
dfs(i, "");
}
int maxLength = N;
System.out.println(String.format("%" + maxLength + "s", maxBinary).replace(' ', '0'));
sc.close();
}
private static void dfs(int node, String path) {
visited[node] = true;
path += S.charAt(node - 1);
if (path.length() == N && path.compareTo(maxBinary) > 0) {
maxBinary = path;
} else if (path.length() > N) {
if (path.substring(0, N).compareTo(maxBinary) > 0) {
maxBinary = path.substring(0, N);
}
}
for (int neighbor : adj[node]) {
if (!visited[neighbor]) {
dfs(neighbor, path);
}
}
visited[node] = false;
}
}
public class MaxBinaryPath {
static int N;
static String S;
static List<Integer>[] adj;
static boolean[] visited;
static String maxBinary = "";
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
N = sc.nextInt();
S = sc.next();
adj = new ArrayList[N + 1];
for (int i = 1; i <= N; i++) {
adj[i] = new ArrayList<>();
}
for (int i = 0; i < N - 1; i++) {
int u = sc.nextInt();
int v = sc.nextInt();
adj[u].add(v);
adj[v].add(u);
}
visited = new boolean[N + 1];
for (int i = 1; i <= N; i++) {
Arrays.fill(visited, false);
dfs(i, "");
}
int maxLength = N;
System.out.println(String.format("%" + maxLength + "s", maxBinary).replace(' ', '0'));
sc.close();
}
private static void dfs(int node, String path) {
visited[node] = true;
path += S.charAt(node - 1);
if (path.length() == N && path.compareTo(maxBinary) > 0) {
maxBinary = path;
} else if (path.length() > N) {
if (path.substring(0, N).compareTo(maxBinary) > 0) {
maxBinary = path.substring(0, N);
}
}
for (int neighbor : adj[node]) {
if (!visited[neighbor]) {
dfs(neighbor, path);
}
}
visited[node] = false;
}
}
๐3
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int solution(vector<int> &A, vector<int> &B) {
int N = A.size();
vector<vector<int>> dp(2, vector<int>(N, 0));
dp[0][0] = A[0];
dp[1][0] = max(A[0], B[0]);
for (int j = 1; j < N; ++j) {
dp[0][j] = max(dp[0][j - 1], A[j]);
dp[1][j] = min(max(dp[0][j], B[j]), max(dp[1][j - 1], B[j]));
}
return dp[1][N - 1];
} /// MS TASK 2
#include <iostream>
#include <algorithm>
using namespace std;
int solution(vector<int> &A, vector<int> &B) {
int N = A.size();
vector<vector<int>> dp(2, vector<int>(N, 0));
dp[0][0] = A[0];
dp[1][0] = max(A[0], B[0]);
for (int j = 1; j < N; ++j) {
dp[0][j] = max(dp[0][j - 1], A[j]);
dp[1][j] = min(max(dp[0][j], B[j]), max(dp[1][j - 1], B[j]));
}
return dp[1][N - 1];
} /// MS TASK 2
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
PayGlocal is hiring for Junior Software Developer (0-2 years)
Expected Salary: 8-14 LPA
Apply here:
https://linkedin.com/jobs/view/3980168944/
Expected Salary: 8-14 LPA
Apply here:
https://linkedin.com/jobs/view/3980168944/
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Accenture Hiring Tester โค
Experience : 0 to 2 years
Link to apply ๐
https://www.accenture.com/in-en/careers/jobdetails?id=ATCI-4366344-S1689605_en&SRC=RECNau
Experience : 0 to 2 years
Link to apply ๐
https://www.accenture.com/in-en/careers/jobdetails?id=ATCI-4366344-S1689605_en&SRC=RECNau
Accenture
Search Jobs
Search for Accenture jobs and find open positions near you. Learn more about our career opportunities and open job positions to find your fit.
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Magna Hiring Data Engineer ๐
Here's the link ๐
https://jobs.magna.com/job/Bangalore-Date-Engineer/582228917/
Here's the link ๐
https://jobs.magna.com/job/Bangalore-Date-Engineer/582228917/
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company: Sideshift.ai
Location: N/A
Role: Junior Backend Engineer
For Graduates: 2023, 2024
https://applicantai.com/sideshift/junior-backend-engineer/8?ref=web3.career#apply
Location: N/A
Role: Junior Backend Engineer
For Graduates: 2023, 2024
https://applicantai.com/sideshift/junior-backend-engineer/8?ref=web3.career#apply
Applicant AI
Careers at SideShift.ai (2 New Jobs)
There are 2 jobs at SideShift.ai: Finance & Accounts Manager and BD & Sales Lead. Join SideShift.ai. ๐ The No Sign-Up Crypto Exchange // Shift BTC, ETH, BCH, SOL, XAI and 100+ other cryptocurrencies, no account required.
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Apply At OpenGig
SDE Intern - NextJs / NodeJs
Stipend : 20 - 30k fixed
Location : Remote
Form : https://forms.gle/gs8DcYtBjQg8PP6L6
SDE Intern - NextJs / NodeJs
Stipend : 20 - 30k fixed
Location : Remote
Form : https://forms.gle/gs8DcYtBjQg8PP6L6
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Deloitte hiring Interns
Eligibility : Any Stream / Any Graduate
https://www.linkedin.com/jobs/view/3980132277
Eligibility : Any Stream / Any Graduate
https://www.linkedin.com/jobs/view/3980132277
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Kyndryl is hiring for Application Developer
Bangalore Location
Partically Remote
Bachelors degree required
Apply Fast , this job is posted today !
https://kyndryl.wd5.myworkdayjobs.com/KyndrylProfessionalCareers/job/Bangalore-Karnataka-India/Application-Developer_R-19516-1?source=REC_APPLICANT_SOURCE_LinkedIn
Bangalore Location
Partically Remote
Bachelors degree required
Apply Fast , this job is posted today !
https://kyndryl.wd5.myworkdayjobs.com/KyndrylProfessionalCareers/job/Bangalore-Karnataka-India/Application-Developer_R-19516-1?source=REC_APPLICANT_SOURCE_LinkedIn
Myworkdayjobs
Application Developer
Who We Are At Kyndryl, we design, build, manage and modernize the mission-critical technology systems that the world depends on every day. So why work at Kyndryl? We are always moving forward โ always pushing ourselves to go further in our efforts to buildโฆ
๐2
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Align Technology is hiring for Software Engineer Intern
Expected Stipend: 3-6 LPA
Apply here:
https://americas-aligntech.icims.com/jobs/40617/job?mobile=false&width=1070&height=500&bga=true&needsRedirect=false&jan1offset=330&jun1offset=330
Expected Stipend: 3-6 LPA
Apply here:
https://americas-aligntech.icims.com/jobs/40617/job?mobile=false&width=1070&height=500&bga=true&needsRedirect=false&jan1offset=330&jun1offset=330
Global | English (Excluding US & EMEA)
Software Engineer Intern in Hyderabad, Telangana | Careers at APAC-India-IT Delivery Center Hyderabad
Join a team that is changing millions of lives.
Transforming smiles, changing lives.
At Align Technology, we believe a great smile can transform a personโs life, so we create technology that gives people the confidence to take on whateverโsโฆ
๐2
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Toolyt is hiring for Front-end Developer
Expected Salary: 15K-50K per month
Apply here:
https://careers.toolyt.com/front-end-developer-19350/
Expected Salary: 15K-50K per month
Apply here:
https://careers.toolyt.com/front-end-developer-19350/
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Guestara is hiring for ReactJs Frontend Intern
Stipend: 20K - 30K per month
Apply here:
https://wellfound.com/jobs/2999773-reactjs-frontend-intern
Stipend: 20K - 30K per month
Apply here:
https://wellfound.com/jobs/2999773-reactjs-frontend-intern
Atlassian โ
โค1๐1
def countIntersections(startsAt, endsAt):
n = len(startsAt)
events = []
for i in range(n):
events.append((startsAt[i], 'start', i))
events.append((endsAt[i], 'end', i))
events.sort(key=lambda x: (x[0], x[1] == 'start'))
ans = [0] * n
aa = set()
for pos, typ, idx in events:
if typ == 'start':
ans[idx] += len(aa)
for active in aa:
ans[active] += 1
aa.add(idx)
elif typ == 'end':
aa.remove(idx)
return ans
Atlassian 2โ
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
int pre = 0;
const int m = 1e9 + 7;
long long ncr(int n, int r)
{
if (!pre)
{
pre = 1;
dp[0][0] = 0;
dp[1][0] = 1;
dp[1][1] = 1;
for (int i = 2; i <= 40; i++)
{
dp[i][0] = 1;
for (int j = 1; j < i; j++)
{
dp[i][j] = dp[i - 1][j] + dp[i - 1][j - 1];
}
dp[i][i] = 1;
}
}
return dp[n][r];
}
long long count(long long x)
{
long long ans = 0;
long long cnt = 0;
long long len = 0;
while (x > 0)
{
if (x & 1)
{
cnt++;
ans += ncr(len, cnt);
}
len++;
x >>= 1;
}
return ans;
}
unsigned int nextPowerOf2(unsigned int n)
{
n--;
n |= n >> 1;
n |= n >> 2;
n |= n >> 4;
n |= n >> 8;
n |= n >> 16;
n++;
return n;
}
int solve(int n)
{
int fn = nextPowerOf2(n) - 1;
int bc = __builtin_popcount(n);
int ans = count(n);
for (int i = n + 1; i < fn; i++)
{
if (__builtin_popcount(i) == bc)
ans = (ans + 1) % m;
}
return ans;
}
Atlassian 1โ
๐ฑ1
def highest_two_digit_number(cards):
cards.sort(reverse=True)
return cards[0] * 10 + cards[1]
your_cards = list(map(int, input().strip().split()))
opponent_cards = list(map(int, input().strip().split()))
your_max = highest_two_digit_number(your_cards)
opponent_max = highest_two_digit_number(opponent_cards)
result = "true" if your_max > opponent_max else "false"
print(your_max)
print(opponent_max)
print(result)
Goldman Sachs
Try card โ