I am getting this error when submitting Isogram in C:
"An error occurred while running your tests. This might mean that there was an issue in our infrastructure, or it might mean that you have something in your code that’s causing our systems to break.
Please check your code, and if nothing seems to be wrong, try running the tests again."
This is my code:
#include "isogram.h"
#include <string.h>
#include <ctype.h>
#include <stdio.h>
bool is_isogram(const char phrase[])
{
int length = strlen(phrase);
for (int i = 0; i < length; i++)
{
for (int j = i + 1; j < length; j++)
{
if (tolower(phrase[i]) != tolower(phrase[j]) && phrase[i] != '-' && phrase[j] != '-')
{
printf("Not an isogram!");
return false;
}
}
}
printf("An isogram!");
return true;
}
I’ve narrowed down the issue to the comparison if statement, as the test runs without it, but as this is the key function of the code (and community code I’ve looked at), I’m not sure if this is bug with the platform.