I thinks it count for "the middle yo-kai", from their position. If you encouter 3 types of yo-kai, there "middle" will befriend with you at end of battle.
Tested over 10x battle and i think it right (in my opinion)
Thanks for answered, hopefully somebody can do that, 'cause i think (in my opinion) the game just need 3 code is Infinite Stamina, max money and x99 items :D