suppose we have an array of some string. there is a use case It has to be done.
let myArray = ['a', 'g', 'd', 'e']
let collections = [
{items:['a', 'b']}, ==> false
{items:['a', 'g']}, ==> true
{items:['d', 'f']}, ==> false
{items:['a', 'g', 'd', 'e']}, ==> true
{items:['a', 'g', 'd', 'e', 'o']}, ==> false
{items:['a', 'g','e']}, ==> true
{items:['g']}, ==> true
{items:['g', 'k']}, ==> false
]
my goals:
- only exact match with one item.
- match the only combination of these items.
first of all, I know this query is so expensive cause for every item of this array we have factorial of that query match.
if we have 2 elements in our array we have 2 possible queries. if we have 4 elements we have 4 * 3 * 2 * 1 possible queries.
my second question is: is this relevant? beside of the use case.