Interview Query

Marked Lists

1
Have you seen this question before?

You are given two lists of strings list1 and list2, which are sorted alphabetically in ascending order.

Implement a function that merges these two lists into one sorted list marking all items from list1 and list2 with characters "1""1" and "2""2" respectively at the end of each item and return that list.

Example:

Input:

list1 = ["ball","ninja","plan"]
list2 = ["cat","egg","zoo"]

Output:

def mark_lists(list1,list2) ->
["ball1","cat2","egg2","ninja1","plan1","zoo2"]
Next question: Marketing Channel Metrics
.....
Python 3.9.6
Loading editor
Use Shift + Enter to run code