[PROBLEM] 458. Poor Pigs #193
Labels
dificulty: hard
Hard difficulty problem.
hacktoberfest
Hacktoberfest issue.
problem
LeetCode problem.
Difficulty
Hard
Problem Description
There are
buckets
buckets of liquid, where exactly one of the buckets is poisonous. To figure out which one is poisonous, you feed some number of (poor) pigs the liquid to see whether they will die or not. Unfortunately, you only haveminutesToTest
minutes to determine which bucket is poisonous.You can feed the pigs according to these steps:
minutesToDie
minutes. You may not feed any other pigs during this time.minutesToDie
minutes have passed, any pigs that have been fed the poisonous bucket will die, and all others will survive.Given
buckets
,minutesToDie
, andminutesToTest
, return the minimum number of pigs needed to figure out which bucket is poisonous within the allotted time.Example 1:
Example 2:
Constraints:
1 <= buckets <= 1000
1 <= minutesToDie <= minutesToTest <= 100
Link
https://leetcode.com/problems/poor-pigs/
The text was updated successfully, but these errors were encountered: