# DCP-381: MULTIPLICATION

Dev Skill archived problems can be discussed here.

### DCP-381: MULTIPLICATION

How to solve this problem? Any hints or algorithm...

Posts: 3
Joined: Wed Nov 29, 2017 1:51 pm

### Re: DCP-381: MULTIPLICATION

You may think about dynamic programming.
There will be two transitions:
1.) take and multiply the value at index p.
2.) do not take value at index p.

Posts: 43
Joined: Tue Jan 17, 2017 10:10 pm

### Re: DCP-381: MULTIPLICATION

But value can be very large, how to use this value as a state of DP?

Posts: 3
Joined: Wed Nov 29, 2017 1:51 pm

### Re: DCP-381: MULTIPLICATION

You have to find a formula.
Find a formula for fewer elements sets.You can use the formula larger elements sets

Posts: 1
Joined: Tue Dec 05, 2017 1:56 am

### Re: DCP-381: MULTIPLICATION

You just need to memorize "position" state to determine whether to take value at that position or not.
As the length of array is 1000. You can easily manage that in dp.

Posts: 43
Joined: Tue Jan 17, 2017 10:10 pm

### Re: DCP-381: MULTIPLICATION

Thanks everyone, including Rajib vai for helping me in this problem. AC...

Posts: 3
Joined: Wed Nov 29, 2017 1:51 pm