haoel/leetcode

[pascalTriangle.II]Something wrong

keenbin opened this issue · 3 comments

In code

for (int i=0; i<rowIndex; i++){
        for(int j=i+1; j>0; j--){
           v[j] += v[j-1];
        } 
    }

when i equals rowIndex-1 and j equals rowIndex, the v doesn't have the element at v[j].

Your text is messy. You can learn Markdown here: https://guides.github.com/features/mastering-markdown/ And you should try to speak in English with @haoel and other people.

👍 I agree it seems like a careless mistake. You can try to make a pull request with your more elegant code for it.

thanks! @jakwings

@keenbin Thanks so much to find this problem! You're absolutely right, that's a serious out of boundary issue.

and I noticed you fired a pull request #31, and I accepted it yesterday. So, I will close this issue.

Thanks you again! and sorry for late response!