Java Hyd Team
746 subscribers
986 photos
39 videos
670 files
690 links
https://teamhydteam.my.canva.site/

Can visit us on our website 😊
Still working on it 😊
Download Telegram
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

public class TestEmp {

public static void main(String[] args ) {
List<Employeee1> empList = new ArrayList<>();
empList.add(new Employeee1(1, 10000));
empList.add(new Employeee1(2, 15000));
empList.add(new Employeee1(3, 12000));

System.out.println("Before Total Sal----------------");
empList.forEach(System.out::println);

// for(Employeee1 e : empList) {
// int da = (int) (e.basicSal * 0.2);
// int hra = (int) (e.basicSal * 0.3);
// e.totalSal = da + hra + e.basicSal;
// }
// System.out.println("After Total sal----------------");
// empList.forEach(System.out::println);
//
// List<Employeee1> lowSal = new ArrayList<>();
// for(Employeee1 e : empList) {
// if(e.totalSal < 20000) {
// e.totalSal += 5000;
// lowSal.add(e);
// }
// }
//
// System.out.println("After Low----------------");
// lowSal.forEach(System.out::println);

System.out.println("Streams------------");

List<Employeee1> streamList = empList.stream().map(e -> {
int da = (int) (e.basicSal * 0.2);
int hra = (int) (e.basicSal * 0.3);
e.totalSal = da + hra + e.basicSal;
return e;
}).collect(Collectors.toList());

for(Employeee1 e : streamList) {
System.out.println(e.toString());
}
System.out.println("Streams low sal------------");

streamList.stream().filter(e -> e.totalSal < 20000).map(e -> {
e.totalSal += 5000;
return e;
}).forEach(System.out::println);

}
}
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 + "]";
}





}
import java.util.*;
public class TestStream {

public static void main(String[] args) {

List<Integer> iList = Arrays.asList(2,3,4,5,6,7,8);

iList.stream().filter(i -> i%2==0).map(i -> i*i).filter(i->i<50).forEach(System.out::println);
}

}
Kindly check files in channel for PDFs , handwritten notes , docs n many more concepts if still having issues ping us @stockkida
You can join this group for messaging
I will send today's code tomorrow 😊
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
Anyone joining this ?? Contest
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.
Height of Binary Tree After Subtree Removal Queries
Input: root = [1,3,4,2,null,6,5,null,null,null,null,null,7], queries = [4]
Output: [2]
Explanation: The diagram above shows the tree after removing the subtree rooted at node with value 4.
The height of the tree is 2 (The path 1 -> 3 -> 2).
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).
😒😒
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.
Q1 level easy
Q2.) Level medium
Q3.) Level medium