[JAVA] Clean Code, O(N) Time Complexity
\nclass Solution {\n    public int poorPigs(int buckets, int minutesToDie, int minutesToTest) {\n        \n        int time = (minutesToTest / minutesToDie) + 1
```\nclass Solution {\n    public int poorPigs(int buckets, int minutesToDie, int minutesToTest) {\n        \n        int time = (minutesToTest / minutesToDie) + 1;\n        int pigs = 0;\n        int total = 1;\n        \n        while (total < buckets) {\n            ++pigs;\n            total *= time;\n        }\n        \n        return pigs;\n    }\n}\n```\n\nPlease help to **UPVOTE** if this post is useful for you.\nIf you have any questions, feel free to comment below.\n**HAPPY CODING :)\nLOVE CODING :)**
[]