1230. Toss Strange Coins

You have some coins.  The i -th coin has a probability  prob[i] of facing heads when tossed.

Return the probability that the number of coins facing heads equals target if you toss every coin exactly once.

 

Example 1:

Input:

 prob = [0.4], target = 1
Output:

 0.40000

Example 2:

Input:

 prob = [0.5,0.5,0.5,0.5,0.5], target = 0
Output:

 0.03125

 

Constraints:

Difficulty:

Medium

Lock:

Prime

Company:

Twitch

Solution(Chinese):

LEETCODE 1230. Toss Strange Coins 解题思路分析