
LeetCode
coderwait
推荐系统、图神经网络
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
【LeetCode】7. Reverse Integer
对于a,b,取余和取模运算分为两步: (1)求整数商: (2)计算模或者余数: 取余和取模的差别在于求整数商的不同:取余,遵循尽可能让商向0靠近的原则;取模,遵循尽可能让商向负无穷靠近的原则。 e.g., 4rem(-3)=1(商取-1) 4mod(-3)=-2(商取-2) 简单地,对于负数对正数的%运算,可以用绝对值计算后再直接计算符号。 e.g., cout<<4...原创 2019-05-27 15:21:42 · 285 阅读 · 0 评论 -
【LeetCode】Problem List and Solutions
Problem Key Star(s) Date Attention 2.Add Two Numbers 链表 ⭐⭐ May 29,2019 7.Reverse Integer ⭐ May 27,2019 取余和取模的区别 8.S...原创 2019-09-28 22:51:30 · 122 阅读 · 0 评论 -
【LeetCode】392. Is Subsequence
392.Is Subsequence Given a stringsand a stringt, check ifsis subsequence oft. You may assume that there is only lower case English letters in bothsandt.tis potentially a very long (lengt...原创 2019-06-08 22:29:46 · 131 阅读 · 0 评论 -
【LeetCode】455. Assign Cookies
455.Assign Cookies Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a greed factor gi, which is the ...原创 2019-06-08 22:11:13 · 96 阅读 · 0 评论 -
【LeetCode】 45. Jump Game II
45.Jump Game II Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length at that position...原创 2019-06-08 21:46:23 · 140 阅读 · 0 评论 -
【LeetCode】240. Search a 2D Matrix II
240.Search a 2D Matrix II Medium Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties: Integers in each row are sorted in ascending f...原创 2019-05-29 17:13:22 · 106 阅读 · 0 评论 -
【LeetCode】169. Majority Element
169.Majority Element Easy Given an array of sizen, find the majority element. The majority element is the element that appearsmore than⌊ n/2 ⌋times. You may assume that the array is non-empty ...原创 2019-05-29 14:16:46 · 128 阅读 · 0 评论 -
【LeetCode】2. Add Two Numbers
2.Add Two Numbers Medium You are given twonon-emptylinked lists representing two non-negative integers. The digits are stored inreverse orderand each of their nodes contain a single digit. Add ...原创 2019-05-29 13:49:23 · 106 阅读 · 0 评论 -
【LeetCode】15. 3Sum
参考TwoSum问题 15.3Sum Medium Given an arraynumsofnintegers, are there elementsa,b,cinnumssuch thata+b+c= 0? Find all unique triplets in the array which gives the sum of zero. Note: T...原创 2019-05-29 12:43:09 · 137 阅读 · 0 评论 -
【LeetCode】1. Two Sum
1.Two Sum Easy Given an array of integers, returnindicesof the two numbers such that they add up to a specific target. You may assume that each input would haveexactlyone solution, and you may...原创 2019-05-29 10:38:26 · 139 阅读 · 0 评论 -
【LeetCode】120. Triangle
120.Triangle Medium Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. For example, given the following triangle [ ...原创 2019-05-28 18:26:41 · 107 阅读 · 0 评论 -
【LeetCode】8. String to Integer
8.String to Integer (atoi) Implementatoiwhichconverts a string to an integer. The function first discards as many whitespace characters as necessary until the first non-whitespace character i...原创 2019-05-27 16:59:04 · 107 阅读 · 0 评论 -
【LeetCode】53. Maximum Subarray
53.Maximum Subarray Easy Given an integer arraynums, find the contiguous subarray(containing at least one number) which has the largest sum and return its sum. Example: Input: [-2,1,-3,4,-1,2,...原创 2019-09-28 23:08:27 · 134 阅读 · 0 评论