You are provided an n-length height integer array. There are n vertical lines made using I 0) and as the two ends of the ith line (i, height[i]). Find two lines that, when joined with the x-axis, produce a container with the most water inside.
You are provided an n-length height integer array. There are n vertical lines made using I 0) and as the two ends of the ith line (i, height[i]). Find two lines that, when joined with the x-axis, produce a container with the most water inside.
题目类型: 技术面试题
这是一道技术面试题,常见于澳洲IT公司面试中。
难度: easy
标签: interviewbit, qualcomm, company-specific
目标公司: Qualcomm
参考答案摘要
Return the most water that a container can hold. Keep in mind that you cannot tilt the container. Example 1: Input: height = [1,8,6,2,5,4,8,3,7] Output: 49 Explanation: The above vertical lines are re...
本题提供 STAR 原则详细解答和技术解析,登录匠人学院学习中心即可查看完整答案。