Тэги:
#Java #Common_Elements #Find_common_elements_in_three_sorted_arraysКомментарии:
very well explained.
ОтветитьUsing HashSet is very smart here
ОтветитьWhat if array is not sorted.. Then which approach will you use
ОтветитьThis program will not pass all cases it consists of so many bugs
ОтветитьNice video but one minor correction: You should state explicitly that your first O(m+n) solution works ONLY for sorted arrays. The failing test case is [6,1,2,3] and [1,2,3]. Your second O(m+n) solution works for both types of arrays obviously.
Ответитьhow do we ignore repeated number for eg arr1=[1,2,3,4,5] arr2=[1,1,2,2,3] output= 1,1,2,2 but desired output =[1,2]
ОтветитьWhat if the 2nd array contains 2 values which are same. It would be printed 2 times which is wrong
Ответитьsame as two array of tunion example can you explain sir
ОтветитьYou're finding common elements, this is not intersection.
ОтветитьCan u pls tell me the platform u r using sir or the software
ОтветитьCode link is present in the description box.
ОтветитьThe way you have explained two approaches to solve this problem is awesome.
Ответить