Double index\ two criteria

I’m curious if there is a native way to look for two items in a list at once.

Currently, I use a two-dimensional array or a single list that I find the first value and then loop through the list to find the second value.

For example I have a bunch of ints that I need to retrieve based on two values. (some lsits are quite long)

A,A,1,2,3
B,B,1,3,3
C,A,1,4,3
B,A,3,1,3
C,A,1,2,3
A,Z,1,2,3

I need to retrieve the values where C, A, which are my inputs. I find C (which is non-unique) and then I need to look at all combinations for C until I find “A”

Is there an object that allows me to retrieve it directly (similar to how I find a dictionary item,index in array etc.

Edit: I have too many values to combine them into a checksum etc.

Thank you

You could serialize your two-dimensional keys and use a HashMap to map each key to their list of values, something like :

TMap<FString, TArray<int32>> Table;

void Set(const FString& Key1, const FString& Key2, TArray<int32>& Values)
{
    Table.Add(Key1 + Key2, Values);
}

TArray<int32>* Get(const FString& Key1, const FString& Key2)
{
    return Table.Find(Key1 + Key2);
}