Write a function that takes in two sorted lists and outputs a sorted list that is their union?



Write a function that takes in two sorted lists and outputs a sorted list that is their union?..

Answer / Neetu Pandey

A simple Python solution would be: def union(list1, list2): merged = sorted(list1 + list2) return (list(set(merged)))

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Data Science Interview Questions

How will you impute missing information in a dataset?

1 Answers   Airbnb,


What is meant by Random Forest Classifier?

1 Answers  


What will you do if removing missing values from a dataset cause bias?

1 Answers   Airbnb,


What is jupyter ?

1 Answers  


How do you check for data quality?

1 Answers  


A certain couple tells you that they have two children, at least one of whom is a girl. What is the probability that they have two girls?

1 Answers  


What is linear optimization?

1 Answers  


Name three disadvantages of using a linear model?

1 Answers  


A test has a true positive rate of 100% and false positive rate of 5%. There is a population with a 1/1000 rate of having the condition the test identifies. Considering a positive test, what is the probability of having that condition?

1 Answers  


Explain the differences between univariate and bivariate analysis?

1 Answers  


Define standard deviation, mean, mode and median.

1 Answers   Mu Sigma,


Can you define analytics?

1 Answers  


Categories
  • AI Algorithms Interview Questions AI Algorithms (74)
  • AI Natural Language Processing Interview Questions AI Natural Language Processing (96)
  • AI Knowledge Representation Reasoning Interview Questions AI Knowledge Representation Reasoning (12)
  • AI Robotics Interview Questions AI Robotics (183)
  • AI Computer Vision Interview Questions AI Computer Vision (13)
  • AI Neural Networks Interview Questions AI Neural Networks (66)
  • AI Fuzzy Logic Interview Questions AI Fuzzy Logic (31)
  • AI Games Interview Questions AI Games (8)
  • AI Languages Interview Questions AI Languages (141)
  • AI Tools Interview Questions AI Tools (11)
  • AI Machine Learning Interview Questions AI Machine Learning (659)
  • Data Science Interview Questions Data Science (671)
  • Data Mining Interview Questions Data Mining (120)
  • AI Deep Learning Interview Questions AI Deep Learning (111)
  • Generative AI Interview Questions Generative AI (153)
  • AI Frameworks Libraries Interview Questions AI Frameworks Libraries (197)
  • AI Ethics Safety Interview Questions AI Ethics Safety (100)
  • AI Applications Interview Questions AI Applications (427)
  • AI General Interview Questions AI General (197)
  • AI AllOther Interview Questions AI AllOther (6)