You are given two arrays, A and B, each containing integers. Find all integers that appear in both A and B and return a new array containing them.
Given a problem scenario, develop an algorithmic solution.
创建一个新的空数组C。遍历数组A和B。对于在A和B中遇到的每个元素，检查是否已经在C中出现。如果是，则继续遍历，否则将其添加到C中。将C作为结果返回。