Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datapoint CPP/38 has some issue #257

Open
DNXie opened this issue Sep 16, 2024 · 0 comments
Open

Datapoint CPP/38 has some issue #257

DNXie opened this issue Sep 16, 2024 · 0 comments

Comments

@DNXie
Copy link

DNXie commented Sep 16, 2024

The datapoint in Humaneval-x CPP/38 has a few lines repeated between declaration and canonical_solution

The declaration is

...
string decode_cyclic(string s){ 
   int l=s.length();
    int num=(l+2)/3;
    string x,output;
    int i;
    for (i=0;i*3<l;i++)
    {

The solution is

    int l=s.length();
    int num=(l+2)/3;
    string x,output;
    int i;
    for (i=0;i*3<l;i++)
    {
        x=s.substr(i*3,3);
        if (x.length()==3) x=x[2]+x.substr(0,2);
        output=output+x;
    }
    return output;


}

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

No branches or pull requests

1 participant