Popular posts from this blog
Given two sorted arrays of size m and n .Find the number of common elements in them and also find what are that common elements.
This can be done in 3 ways :(considering worst case)//only for sorted 1. O(m*n) // if m == n, then (n*n) 2. O(nLog(m))// if m>n else O(mLog(n)) Using Binary search 3. O(m + n) // this is optimal worst case time// using concept of merge sort for example : array a[] = { 10,20,30.40,50,60,70,80,90};//only for sorted array b[] = { 10,15,20,25,30}; output : 10 20 30 number of same elements : 3 follow me on : Instagram Twitter LinkedIn my website facebook Whatsapp gmail
DNA CONCAT asked in WIPRO feb 2022
The first line of input consists of an integer- numSample, representing the number of DNA samples in the 8 9 facility. 10 11 The next line consists of N space-separated strings representing the DNA samples.The last line of input consists of an integer- new count, representing the number of DNA samples to be combined in order to form ney mutants Output Print a space-separated string containing DNA for the new mutants.
Comments
Post a Comment