Title Printing the Total Number of Times Elements of One List Appear in Another List
Catalog Type SLCItem
Persistent ID https://acos.cs.vt.edu/html/acos-pcex/acos-pcex-examples/py_search_list_llm__677c888e4ef8609babb3050b?index=1
Platform Name PCEX
Features
Description Construct a program that has a function that receives two lists and prints the total number of times the elements in the 2nd list appear in the 1st list. For example, if the 1st list is [1, 2, 3, 3, 4, 4, 5, 6] and the 2nd list is [3, 4, 5, 6, 7], then the total number of times that the elements in the 2nd list appear in the 1st list is 6.\nNote that we need to count matches for all values in the 2nd list (including duplicate values, if any).
Keywords
Author Mohammad Hassany
Institution University of Pittsburgh
Iframe URL https://acos.cs.vt.edu/html/acos-pcex/acos-pcex-examples/py_search_list_llm__677c888e4ef8609babb3050b?index=1
Protocol SPLICE
Protocol URL
License MIT
Programming Language PYTHON
Natural Language en

Preview

SPLICE Output