Yuanyeex

传递价值,准求卓越

Leetcode.11 Container With Most Water 盛最多水的容器

题目描述: 给定一个长度为n的整数数组,表示n个垂直的线。在二维坐标系里面,第i个垂直的线的两端的坐标是(i,0)和(i, height[i])

Leetcode.415 Add Strings 字符串求和

Given two non-negative integers, num1 and num2 represented as string, return the sum of num1 and num2 as a string. You must solve the problem without using any built-in library for handling large integers (such as BigInteger). You must also not convert the inputs to integers directly. Example 1: Input: num1 = "11", num2 = "123" Output: "134" Example 2: Input: num1 = "456", num2 = "77" Output: "533" Example

Leetcode.118 Pascals Triangle 杨辉三角

Given an integer numRows, return the first numRows of Pascal’s triangle. In Pascal’s triangle, each number is the sum of the two numbers directly above it as shown: Example 1: Input: numRows = 5 Output: [[1],[1,1],[1,2,1],[1,3,3,1],[1,4,6,4,1]] Example 2: Input: numRows = 1 Output: [[1]] Constraints: 1 <= numRows <= 30 解题思路 这道题比较简单,可以递归,也可以