Click4Ai

435.

Medium

Thompson Sampling Problem

**Example:** Imagine you are a gambler and you have to decide whether to bet on a coin toss. The coin toss can result in either heads or tails, and you want to maximize your expected reward.

**Constraints:** The gambler's reward is determined by the coin toss result, and the gambler's prior belief about the coin toss result is 0.5.

Test Cases

Test Case 1
Input: [0.5, 0.5]
Expected: 0
Test Case 2
Input: [0.6, 0.4]
Expected: 1
+ 3 hidden test cases