Search:

Type: Posts; User: Sean4u

Search: Search took 0.07 seconds.

  1. Replies
    13
    Views
    3,951

    Re: Product of array values

    All 5-way products that include a zero term are themselves zero. If your current greatest is greater than zero then on first encountering a zero element in the input array, you could reset your...
  2. Replies
    13
    Views
    3,951

    Re: Product of array values

    Absolutely right - I didn't see that one coming! It's going to make the loop look a bit messier, but you could check for 'a zero leaving the window' and recalculate the 5-way product. I can't think...
  3. Replies
    13
    Views
    3,951

    Re: Product of array values

    Urban Dictionary: op

    I meant the first definition, unless urbandictionary presents the page to you in a different order.
  4. Replies
    13
    Views
    3,951

    Re: Product of array values

    That is the answer to the question you asked. You'll need to do this each time around the loop, but I held off pointing out yesterday that you were creating a list of results for a problem that said...
  5. Replies
    13
    Views
    3,951

    Re: Product of array values

    If you loop for every element in your input integer array, you can multiply your product variable by the current element each time. If the current element is placed 4 or higher, you output the...
  6. Replies
    13
    Views
    3,951

    Re: Product of array values

    The reason OP is using constant array index increments is because of my suggestion to 'slide a window':...
Results 1 to 6 of 6