Sherlock and Array

  • + 3 comments

    for( int i = 0 ; i < n ; i++)
    {

    lc += a[i-1];
        ...
    
        You will get ArrayIndexOutOfBoundsException for i=0