1) forget about code. how would you do it, by hand? Write out the steps in English.
2) break the problem down into small pieces that are independent. For example, it doesn't matter HOW you get the list/array of numbers, but once you have it, what do you need to do with it? Write that part. For the time being, you could even hard-code your array, and worry about getting user input later.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors