2335. Minimum Amount of Time to Fill Cups

  Рет қаралды 12

CodeVia

CodeVia

6 ай бұрын

2335. Minimum Amount of Time to Fill Cups #leetcodequestionandanswers #java #coding #microsoftinterview #javainterviewquestions #interview #amazoninterviewpreparation #googleinterview #leetcode #javaprogramming #dsa #dsalgo #programming
leetcode.com/problems/minimum...
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.

Пікірлер
Llegó al techo 😱
00:37
Juan De Dios Pantoja
Рет қаралды 54 МЛН
Heartwarming Unity at School Event #shorts
00:19
Fabiosa Stories
Рет қаралды 22 МЛН
아이스크림으로 체감되는 요즘 물가
00:16
진영민yeongmin
Рет қаралды 63 МЛН
Auto Suggestion in Eclipse 2024
1:00
PARENTAL LESSONS
Рет қаралды 25
Formatting your code in more Readable Format
3:12
Priyanshu Verma
Рет қаралды 27
how to add two numbers in java
3:03
Java Life
Рет қаралды 37
Two Pointer Algorithm | Two Sum Problem | Solve DS Problems in O(N) Time
19:18
JAVAAID - Coding Interview Preparation
Рет қаралды 111 М.
your age is not an indicator of intelligence
5:24
Brian Logic
Рет қаралды 1 М.
Swift Programming Tutorial for Beginners (Full Tutorial)
3:22:45
CodeWithChris
Рет қаралды 7 МЛН
Llegó al techo 😱
00:37
Juan De Dios Pantoja
Рет қаралды 54 МЛН