SubsetCount
SubsetCount[list,sub]
gives a count of the number of times sub appears in any order as a sublist of list.
SubsetCount[list,patt]
gives the number of sublists in list that match the general pattern patt in any order.
Details and Options
- In SubsetCount[list,patt], patt can be an expression with head List that includes pattern constructs such as PatternSequence, Repeated (..), Blank (_) and BlankSequence (__).
- The pattern patt can also be a pattern that matches a list but does not itself have head List.
- With the default option setting OverlapsFalse, SubsetCount includes only sublists that do not overlap. With the setting OverlapsTrue, it includes sublists that overlap.
Examples
open allclose allBasic Examples (2)
Properties & Relations (1)
The rules for counting are defined by the length of the result of SubsetCases:
Text
Wolfram Research (2020), SubsetCount, Wolfram Language function, https://reference.wolfram.com/language/ref/SubsetCount.html.
CMS
Wolfram Language. 2020. "SubsetCount." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SubsetCount.html.
APA
Wolfram Language. (2020). SubsetCount. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SubsetCount.html