We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • Practice
  • Certification
  • Compete
  • Career Fair
  • Hiring developers?
  1. Practice
  2. Algorithms
  3. Search
  4. Sherlock and Array
  5. Discussions

Sherlock and Array

Problem
Submissions
Leaderboard
Discussions
Editorial

    You are viewing a single comment's thread. Return to all comments →

  • Balaji_4 5 years ago+ 0 comments

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

    lc += a[i-1];
        ...
    
        You will get ArrayIndexOutOfBoundsException for i=0
    
    9|
    ParentPermalink
  • Contest Calendar
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy
  • Request a Feature