首页
AI Coding
NEW
沸点
课程
直播
活动
AI刷题
APP
插件
搜索历史
清空
创作者中心
写文章
发沸点
写笔记
写代码
草稿箱
创作灵感
查看更多
会员
登录
注册
leetcode
我是王大你是谁
创建于2021-05-12
订阅专栏
python 解答 leetcode
等 30 人订阅
共750篇文章
创建于2021-05-12
订阅专栏
默认顺序
默认顺序
最早发布
最新发布
leetcode 242. Valid Anagram ( Python )
Given two strings s and t , write a function to determine if t is an anagram of s. 根据题意,就是找出 s 和 t 两个字符串是不是同字母异序词,时间复杂度为 O(N),空间复杂度为 O(1)。 …
leetcode 976. Largest Perimeter Triangle ( Python )
Given an array A of positive lengths, return the largest perimeter of a triangle with non-zero area, formed from 3 of these lengths. If it …
leetcode 349. Intersection of Two Arrays ( Python )
Given two arrays, write a function to compute their intersection. 根据题意,就是找出交集列表,时间复杂度 O(N+M),O(N) 用于 nums1 转换成 set , O(M) 用于 nums2 转换成 set …
leetcode 198. House Robber ( Python )
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint …
leetcode 53. Maximum Subarray( Python )
iven an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. 根据题…
leetcode 121. Best Time to Buy and Sell Stock ( Python )
Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one …
leetcode 746. Min Cost Climbing Stairs ( Python )
On a staircase, the i-th step has some non-negative cost cost[i] assigned (0 indexed). Once you pay the cost, you can either climb one or t…
leetcode 70. Climbing Stairs ( Python )
You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways…
leetcode 268. Missing Number( Python )
Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. 根据题意肯定用公式计算方法最快,就是把 M…
leetcode 661. Image Smoother( Python )
Given a 2D integer matrix M representing the gray scale of an image, you need to design a smoother to make the gray scale of each cell beco…
leetcode 717. 1-bit and 2-bit Characters ( Python )
We have two special characters. The first character can be represented by one bit 0. The second character can be represented by two bits (1…
leetcode 169. Majority Element ( Python )
Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assu…
leetcode 167. Two Sum II - Input array is sorted( Python )
Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number. T…
leetcode 217. Contains Duplicate ( Python )
Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice…
leetcode 448. Find All Numbers Disappeared in an Array( Python )
Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements…
leetcode 283. Move Zeroes( Python )
Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. 就是把左右…
leetcode 485. Max Consecutive Ones( Python )
Given a binary array, find the maximum number of consecutive 1s in this array. 遍历所有的数组元素,遇到 1 就计数,遇到 0 就更新一次最大个数 result,直到最后遍历完所有元素。 每日格言:每…
leetcode 1013. Partition Array Into Three Parts With Equal Sum( Python )
Given an array A of integers, return true if and only if we can partition the array into three non-empty parts with equal sums. Formally, w…
leetcode 896. Monotonic Array( Python )
An array is monotonic if it is either monotone increasing or monotone decreasing. An array A is monotone increasing if for all i <= j, A[i]…
leetcode 985. Sum of Even Numbers After Queries( Python )
We have an array A of integers, and an array queries of queries. For the i-th query val = queries[i][0], index = queries[i][1], we add val …
下一页