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

shifting.java bug #151

Open
andytang2008 opened this issue Aug 24, 2022 · 2 comments
Open

shifting.java bug #151

andytang2008 opened this issue Aug 24, 2022 · 2 comments

Comments

@andytang2008
Copy link

andytang2008 commented Aug 24, 2022

ignore[w] = e.length - k +(w+1); is wrong
When Object arr[] = {12, 8, 11, 13, 10, 15, 14, 16, 20};
k=4, the result is wrong.

May be change into
ignore[w] = combination.length +(w);

The shifting ignored indices part has some bug. I also change it into
while(w>0){
if(w > 0){
ignore[w-1] = ignore[w]-1;
System.out.println(" **ignore[w-1]= "+ (ignore[w]-1));;
}
w--;
}

@huangfuyixiao
Copy link

huangfuyixiao commented Aug 24, 2022 via email

@Khomendra
Copy link

Could you share Readme or documentation file?

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

3 participants