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
Logic :- DIVIDE AND RULE

4. Median of Two Sorted Arrays
Level Hard
Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays.

The overall run time complexity should be O(log (m+n)).



Example 1:

Input: nums1 = [1,3], nums2 = [2]
Output: 2.00000
Explanation: merged array = [1,2,3] and median is 2.
Example 2:

Input: nums1 = [1,2], nums2 = [3,4]
Output: 2.50000
Explanation: merged array = [1,2,3,4] and median is (2 + 3) / 2 = 2.5.


Constraints:

nums1.length == m
nums2.length == n
0 <= m <= 1000
0 <= n <= 1000
1 <= m + n <= 2000
-106 <= nums1[i], nums2[i] <= 106
πŸ‘1
HCL Tech is hiring for Developer
Role: Developer
Passout year: 2022 and before
Experience: Freshers
Location: Pune
Qualification: BE/ B.Tech
Salary: β‚Ή 4.5 Lakh per year



Apply Now:
https://www.hcltech.com/jobs/developer-5
Apply after 5pm
Microsoft is hiring for Research Intern
Role: Research Intern
Passout year: 2023/2024/2025
Qualification: BE/B.Tech/ME/M.Tech/MCA/MSC
Salary: 60k - 70k per month
Location: Benguluru



Apply Now: https://careers.microsoft.com/us/en/job/1491041/
The @Qualifier annotation in Spring is used to differentiate a bean among the same type of bean objects.

If we have more than one bean of the same type and want to wire only one of them then use the @Qualifier annotation along with @Autowired to specify which exact bean will be wired.

If we don't use this annotation in the given project then we get an error like:

Caused by: org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type
This media is not supported in your browser
VIEW IN TELEGRAM
πŸ‘1
The @Required annotation applies to bean property setter methods and it indicates that the affected bean property must be populated in XML configuration file at configuration time. Otherwise, the container throws a BeanInitializationException exception
public class Student {
private Integer age;
private String name;

@Required
public void setAge(Integer age) {
this.age = age;
}
public Integer getAge() {
return age;
}

@Required
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
}
import org.springframework.context.annotation.*;

@Configuration
public class HelloWorldConfig {
@Bean
public HelloWorld helloWorld(){
return new HelloWorld();
}
}