-
Code def remove(integers, values): return list(filter(lambda x: x not in values,integers))
Test Cases describe("Basic Test Cases") def basic_test_cases(): test.assert_equals(remove([], []), []) test.assert_equals(remove([1, 1, 3, 5, 7, 7, 7, 9, 10, 10], [1, 7, 9]), [3, 5, 10, 10]) test.assert_equals(remove([1, 2, 3, 4, 5], [2, 4]), [1, 3, 5])
.Output:
-
Code - def remove(integers, values):
return [x for x in integers if x not in set(values)]- return list(filter(lambda x: x not in values,integers))
- All
- {{group.name}} ({{group.count}})
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}