Help me figure out why my code is wrong

It is a C++ code for the practice question “Testing the robot”
The link to the problem is “TSTROBOT Problem - CodeChef

#include
using namespace std;

int main()
{
int y=0;
int n;
int c=0;
int x;
cin>>n>>x;
int m=0;

char com[100];
for(int i=0;i<n;i++)
{
cin>>com[i];
}
for(int j=0;j<n;j++)
{
if(com[j]==‘L’)
{
c=c+1;
}
else
{
y=y+1;
}
}
if(c>y)
{
m=(c-y)+y;
}
else if(y>c)
{
m=(y-c)+c;
}
else
{
m=c;
}
cout<<“the number of distinct points visited is”<<m+1;

return 0;

}

Add link to the problem. Format you code. Explain your approach if possible.
You can’t just paste your code as it is and expect us to fix it.

At least format your code.

1 Like

you can not write enter test cases, enter N and X, Number of distinct points visited is …
like this

2 Likes

I have edited the post and have mentioned the link to the question

I have edited and mentioned the link to the question

follow the input output specified in the question