Much needed for an SDET looking for a job shift. Thank you for a very informative video. Also I get that you are making others learn from the ''Students' mistakes, but might I suggest that you clip the unnecessary parts? It did really take a major chunk of time:(
For finding the sum of common elements in the list, I've deduced 3 approaches. 1. Use nested for loops to check for each and every element, if == , then sum+=sum. (Brute Force) 2. Use a Array, iterate over both of the lists and do index+1 in the array for the corresponding element. Finally sum up all the values in the array whose value ==2 (Since it will be ++1 for duplicate occurrence in each list ) 3. Use a hashmap, post iterating over both lists and adding the frequencies in the hashmap, sum of all the elements whose frequency is '2' [Most Efficient] There could be even better approach, do let me know Sidarth sir
Much needed for an SDET looking for a job shift. Thank you for a very informative video.
Also I get that you are making others learn from the ''Students' mistakes, but might I suggest that you clip the unnecessary parts? It did really take a major chunk of time:(
I agree, I'll try to be more concise in future videos.
For finding the sum of common elements in the list, I've deduced 3 approaches.
1. Use nested for loops to check for each and every element, if == , then sum+=sum. (Brute Force)
2. Use a Array, iterate over both of the lists and do index+1 in the array for the corresponding element. Finally sum up all the values in the array whose value ==2 (Since it will be ++1 for duplicate occurrence in each list )
3. Use a hashmap, post iterating over both lists and adding the frequencies in the hashmap, sum of all the elements whose frequency is '2' [Most Efficient]
There could be even better approach, do let me know Sidarth sir