Got it working a bit differently.
void UBullCowCartridge::CheckBullCows(const FString& Guess, int32& BullCount, int32& CowCount) const
{
BullCount = 0;
CowCount = 0;
for (int i = 0; i < Guess.Len(); ++i)
{
for (int j = 0; j < HiddenWord.Len(); ++j)
{
if (Guess[i] == HiddenWord[j])
{
if (i == j)
BullCount++;
else
CowCount++;
}
}
}
}