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.
Soooo...this comment was three years ago but I would like to ask what specifically was complicated? I think a good practice is to look for comments and they usually explain it well. "code here" would usually mean you don't have to do anything other than put your solution there. I was surprised at the code as well. But the solution was simply, write a int var to return, for loop with addition, and done. You can tell what to return by the data type in front of the method. The rest of it, I would say trying to figure it out, and googling as that is one method of learning.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Simple Array Sum
You are viewing a single comment's thread. Return to all comments →
Soooo...this comment was three years ago but I would like to ask what specifically was complicated? I think a good practice is to look for comments and they usually explain it well. "code here" would usually mean you don't have to do anything other than put your solution there. I was surprised at the code as well. But the solution was simply, write a int var to return, for loop with addition, and done. You can tell what to return by the data type in front of the method. The rest of it, I would say trying to figure it out, and googling as that is one method of learning.