梦开始的地方 (LeetCode 第一题)传送门Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.You may assume that each input would have exactly on...
传送门You are given an array of integers nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each...
传送门Given an array of integers nums which is sorted in ascending order, and an integer target, write a function to search target in nums. If target exists, then return its index. Otherwise, return -...
还是从一道相对简单的问题入手:LeetCode11 - Container With Most Water问题概要:给一个数组,代表一系列墙壁的高度。要求选出两个墙壁,使它们能够储存最多的水。并且:忽略墙壁的厚度忽略选定的墙壁之间的墙壁暴力解法可以轻松想出一个暴力解法:遍历所有墙壁的组合,找出容积最大的一个。class Solution {
fun maxArea(height: Int...