Interview Query

Biggest Tip

Start Timer

0:00:00

Upvote
19
Downvote
Save question
Mark as completed
View comments (45)
Next question

Given two nonempty lists of user_ids and tips, write a function most_tips to find the user that tipped the most.

Example:

Input:

user_ids = [103, 105, 105, 107, 106, 103, 102, 108, 107, 103, 102]
tips = [2, 5, 1, 0, 2, 1, 1, 0, 0, 2, 2]

Output:

def most_tips(user_ids,tips) -> 105
.
.
.
.
.


Comments

Loading comments