Skip to content

Conversation

@Subhamchoudhary77
Copy link

Hey! This is my solution in C programming, if you want to add then please do. This is very easy and understandable code.

Copy link
Owner

@c650 c650 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really take contribs on this repo but I gave you a review :)

Comment on lines +10 to +11
char a[n];
int b[n];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

variable length arrays are bad imo

Comment on lines +18 to +27
if(a[i]=='U'){
x++;
b[i]=x;
}
else
{
x--;
b[i]=x;
}
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you do the same thing in both branches?

Comment on lines +29 to +31
x=0;

for(i=0;i<n;i++)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: spacing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants