8000 shifting.java bug · Issue #151 · hmkcode/Java · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000
shifting.java bug #151
Open
Open
@andytang2008

Description

@andytang2008

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--;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0