id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

gaurav1780@gmail.com 04_lists > is_subset_of
prev  |  next  |  chance

A is said to be a subset of B if, every item in A occurs in B at least as many times as it occurs in A. Define a function that when passed two integer arrays, returns True if the first array is a subset of the second array.


is_subset_of([20, 10], [10, 70, 20, 90]) → True
is_subset_of([20, 20], [10, 70, 20, 90]) → False
is_subset_of([10, 70, 20, 90], [20]) → False

...Save, Compile, Run (ctrl-enter)

def is_subset_of(a, b):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Difficulty: 3 Post-solution available

Copyright Nick Parlante 2017 - privacy