In the question you ask me to create a pair of Right and Left shoes so I used strcmp to compare, I used 1 because the strings have to be different, but I did not get the result that the question asked for.
Link to the question link
Here is my code
#include<stdio.h>
#include<stdlib.h>
#include <string.h>
int main(void)
{
int i, teste, j, c = 0;
while(scanf("%d", &teste) != EOF)
{
c = 0;
int vet[teste];
char nome[teste][100];
for(i = 0; i < teste; i++)
{
scanf("%d %s", &vet[i], nome[i]);
}
for(i = 0; i < teste; i++)
{
for(j = 0; j < teste; j++)
{
if(vet[i] == vet[j])
{
if(strcmp(nome[i], nome[j]) == 1)
{
c++;
}
}
}
}
printf("%d\n", c);
}
}