Yahoo is hiring for Software Developer Intern
Role : SDE intern
Experience: Freshers
Passout year: 2022/2023/2024
Location : India (Work From Home)
Qualification: B.Tech/BE/BSc/BCA/BS
Salary: 50k to 70k per month
Apply Now: https://ouryahoo.wd5.myworkdayjobs.com/en-US/careers/job/India---Remote/Software-Developer-Intern_JR0021340
Role : SDE intern
Experience: Freshers
Passout year: 2022/2023/2024
Location : India (Work From Home)
Qualification: B.Tech/BE/BSc/BCA/BS
Salary: 50k to 70k per month
Apply Now: https://ouryahoo.wd5.myworkdayjobs.com/en-US/careers/job/India---Remote/Software-Developer-Intern_JR0021340
You are given the root of a binary tree with n nodes. Each node is assigned a unique value from 1 to n. You are also given an array queries of size m.
You have to perform m independent queries on the tree where in the ith query you do the following:
Remove the subtree rooted at the node with the value queries[i] from the tree. It is guaranteed that queries[i] will not be equal to the value of the root.
Return an array answer of size m where answer[i] is the height of the tree after performing the ith query.
You have to perform m independent queries on the tree where in the ith query you do the following:
Remove the subtree rooted at the node with the value queries[i] from the tree. It is guaranteed that queries[i] will not be equal to the value of the root.
Return an array answer of size m where answer[i] is the height of the tree after performing the ith query.
Input: root = [5,8,9,2,1,3,7,4,6], queries = [3,2,4,8]
Output: [3,2,3,2]
Explanation: We have the following queries:
- Removing the subtree rooted at node with value 3. The height of the tree becomes 3 (The path 5 -> 8 -> 2 -> 4).
- Removing the subtree rooted at node with value 2. The height of the tree becomes 2 (The path 5 -> 8 -> 1).
- Removing the subtree rooted at node with value 4. The height of the tree becomes 3 (The path 5 -> 8 -> 2 -> 6).
- Removing the subtree rooted at node with value 8. The height of the tree becomes 2 (The path 5 -> 9 -> 3).
Output: [3,2,3,2]
Explanation: We have the following queries:
- Removing the subtree rooted at node with value 3. The height of the tree becomes 3 (The path 5 -> 8 -> 2 -> 4).
- Removing the subtree rooted at node with value 2. The height of the tree becomes 2 (The path 5 -> 8 -> 1).
- Removing the subtree rooted at node with value 4. The height of the tree becomes 3 (The path 5 -> 8 -> 2 -> 6).
- Removing the subtree rooted at node with value 8. The height of the tree becomes 2 (The path 5 -> 9 -> 3).
You are given two string arrays creators and ids, and an integer array views, all of length n. The ith video on a platform was created by creator[i], has an id of ids[i], and has views[i] views.
The popularity of a creator is the sum of the number of views on all of the creator's videos. Find the creator with the highest popularity and the id of their most viewed video.
If multiple creators have the highest popularity, find all of them.
If multiple videos have the highest view count for a creator, find the lexicographically smallest id.
Return a 2D array of strings answer where answer[i] = [creatori, idi] means that creatori has the highest popularity and idi is the id of their most popular video. The answer can be returned in any order.
The popularity of a creator is the sum of the number of views on all of the creator's videos. Find the creator with the highest popularity and the id of their most viewed video.
If multiple creators have the highest popularity, find all of them.
If multiple videos have the highest view count for a creator, find the lexicographically smallest id.
Return a 2D array of strings answer where answer[i] = [creatori, idi] means that creatori has the highest popularity and idi is the id of their most popular video. The answer can be returned in any order.
Java Hyd Team
I will send today's code tomorrow 😊
public class Employeee1 {
int empNo;
int basicSal;
int totalSal;
public Employeee1(int empNo, int basicSal) {
super();
this.empNo = empNo;
this.basicSal = basicSal;
}
public int getEmpNo() {
return empNo;
}
public void setEmpNo(int empNo) {
this.empNo = empNo;
}
public int getBasicSal() {
return basicSal;
}
public void setBasicSal(int basicSal) {
this.basicSal = basicSal;
}
public int getTotalSal() {
return totalSal;
}
public void setTotalSal(int totalSal) {
this.totalSal = totalSal;
}
@Override
public String toString() {
return "Employeee1 [empNo=" + empNo + ", basicSal=" + basicSal + ", totalSal=" + totalSal + "]";
}
}
int empNo;
int basicSal;
int totalSal;
public Employeee1(int empNo, int basicSal) {
super();
this.empNo = empNo;
this.basicSal = basicSal;
}
public int getEmpNo() {
return empNo;
}
public void setEmpNo(int empNo) {
this.empNo = empNo;
}
public int getBasicSal() {
return basicSal;
}
public void setBasicSal(int basicSal) {
this.basicSal = basicSal;
}
public int getTotalSal() {
return totalSal;
}
public void setTotalSal(int totalSal) {
this.totalSal = totalSal;
}
@Override
public String toString() {
return "Employeee1 [empNo=" + empNo + ", basicSal=" + basicSal + ", totalSal=" + totalSal + "]";
}
}
just now i have created a section in my gsheet for competitive coding i will update questions and solutions there so don't miss to join
basics i will share here and on my git competitive codes with answers i will update in gsheet only