TheRealSamuel/LeetCodeProblem
0572
1{2 "id": 2412,3 "name": "minimum_amount_of_time_to_fill_cups",4 "difficulty": "Easy",5 "link": "https://leetcode.com/problems/minimum-amount-of-time-to-fill-cups/",6 "date": "1656806400000",7 "task_description": "You have a water dispenser that can dispense cold, warm, and hot water. Every second, you can either fill up `2` cups with **different** types of water, or `1` cup of any type of water. You are given a **0-indexed** integer array `amount` of length `3` where `amount[0]`, `amount[1]`, and `amount[2]` denote the number of cold, warm, and hot water cups you need to fill respectively. Return _the **minimum** number of seconds needed to fill up all the cups_. **Example 1:** ``` **Input:** amount = [1,4,2] **Output:** 4 **Explanation:** One way to fill up the cups is: Second 1: Fill up a cold cup and a warm cup. Second 2: Fill up a warm cup and a hot cup. Second 3: Fill up a warm cup and a hot cup. Second 4: Fill up a warm cup. It can be proven that 4 is the minimum number of seconds needed. ``` **Example 2:** ``` **Input:** amount = [5,4,4] **Output:** 7 **Explanation:** One way to fill up the cups is: Second 1: Fill up a cold cup, and a hot cup. Second 2: Fill up a cold cup, and a warm cup. Second 3: Fill up a cold cup, and a warm cup. Second 4: Fill up a warm cup, and a hot cup. Second 5: Fill up a cold cup, and a hot cup. Second 6: Fill up a cold cup, and a warm cup. Second 7: Fill up a hot cup. ``` **Example 3:** ``` **Input:** amount = [5,0,0] **Output:** 5 **Explanation:** Every second, we fill up a cold cup. ``` **Constraints:** `amount.length == 3` `0 <= amount[i] <= 100`",8 "public_test_cases": [9 {10 "label": "Example 1",11 "input": "amount = [1,4,2]",12 "output": "4 "13 },14 {15 "label": "Example 2",16 "input": "amount = [5,4,4]",17 "output": "7 "18 },19 {20 "label": "Example 3",21 "input": "amount = [5,0,0]",22 "output": "5 "23 }24 ],25 "private_test_cases": [26 {27 "input": [28 0,29 0,30 031 ],32 "output": 033 },34 {35 "input": [36 100,37 0,38 039 ],40 "output": 10041 },42 {43 "input": [44 60,45 0,46 047 ],48 "output": 6049 },50 {51 "input": [52 10,53 10,54 1055 ],56 "output": 1557 },58 {59 "input": [60 20,61 54,62 063 ],64 "output": 5465 },66 {67 "input": [68 0,69 100,70 10071 ],72 "output": 10073 },74 {75 "input": [76 86,77 54,78 6279 ],80 "output": 10181 },82 {83 "input": [84 37,85 43,86 3487 ],88 "output": 5789 },90 {91 "input": [92 49,93 51,94 795 ],96 "output": 5497 },98 {99 "input": [100 19,101 61,102 9103 ],104 "output": 61105 }106 ],107 "haskell_template": "fillCups :: [Int] -> Int\nfillCups amount ",108 "ocaml_template": "let fillCups (amount: int list) : int = ",109 "scala_template": "def fillCups(amount: List[Int]): Int = { \n \n}",110 "java_template": "public static int fillCups(List<Integer> amount) {\n\n}",111 "python_template": "class Solution(object):\n def fillCups(self, amount):\n \"\"\"\n :type amount: List[int]\n :rtype: int\n \"\"\"\n "112}