My issue
values of x and y
My code
#include <stdio.h>
if (x >= && y >= ) {
return 'NE';
} else if (x < && y >= ) {
return 'NW';
} else if (x < && y < ) {
return 'SW';
} else {
return 'SE';
}
}
int main() {
int T;
scanf("%d", &T);
while(T--) {
int N;
scanf("%d", &N);
int islands[N][2];
for(int i = ; i < N; i++) {
scanf("%d %d", &islands[i][], &islands[i][1]);
}
// Find the number of lighthouses required
printf("%d\n", N);
// Place the lighthouses with their configurations
for(int i = 1; i <= N; i++) {
char quadrant = findQuadrant(islands[i-1][], islands[i-1][1]);
printf("%d %c\n",i,quadrant);
}
}
return ;
}
// your code goes here
}
Problem Link: Lighthouses Practice Coding Problem