- 博客(16)
- 收藏
- 关注
原创 【LeetCode】验证4个点是否构成正方形
问题描述Given the coordinates of four points in 2D space, return whether the four points could construct a square.The coordinate (x,y) of a point is represented by an integer array with two integers.Ex...
2019-01-02 00:01:23 3428
原创 【LeetCode】Can Place Flowers放花问题
问题描述Suppose you have a long flowerbed in which some of the plots are planted and some are not. However, flowers cannot be planted in adjacent plots - they would compete for water and both would die....
2019-01-02 00:01:11 178
原创 【LeetCode】Binary Search二分查找
问题描述Given a sorted (in ascending order) integer array nums of n elements and a target value, write a function to search target in nums. If target exists, then return its index, otherwise return -1.E...
2019-01-01 23:53:34 136
原创 【LeetCode】Student Attendance Record I记录学生出勤率
问题描述You are given a string representing an attendance record for a student. The record only contains the following three characters:‘A’ : Absent.‘L’ : Late.‘P’ : Present.A student could be reward...
2019-01-01 21:51:40 184
原创 【LeetCode】Minimum Number of Arrows to Burst Balloons射箭问题
问题描述There are a number of spherical balloons spread in two-dimensional space. For each balloon, provided input is the start and end coordinates of the horizontal diameter. Since it’s horizontal, y-co...
2019-01-01 21:43:48 225
原创 【LeetCode】Keyboard Row
问题描述Given a List of words, return the words that can be typed using letters of alphabet on only one row’s of American keyboard like the image below.Example:Input: ["Hello", "Alaska", "Dad", "Peace"...
2019-01-01 21:33:48 104
原创 【LeetCode】二叉树路径
问题描述You are given a binary tree in which each node contains an integer value.Find the number of paths that sum to a given value.The path does not need to start or end at the root or a leaf, but it ...
2019-01-01 21:25:12 139
原创 【LeetCode】Guess Number Higher or Lower猜价格高低
问题描述We are playing the Guess Game. The game is as follows:I pick a number from 1 to n. You have to guess which number I picked.Every time you guess wrong, I’ll tell you whether the number is higher...
2019-01-01 21:18:01 116
原创 【LeetCode】01矩阵
问题描述Given a matrix consists of 0 and 1, find the distance of the nearest 0 for each cell.The distance between two adjacent cells is 1.Example 1:Input:0 0 00 1 00 0 0Output:0 0 00 1 00 0 0...
2019-01-01 20:47:08 688
原创 【LeetCode】整数拆分
问题描述Given a positive integer n, break it into the sum of at least two positive integers and maximize the product of those integers. Return the maximum product you can get.Example 1:Input: 2Outpu...
2019-01-01 20:25:38 518
原创 【LeetCode】Sum of Two Integers 2数相加
问题描述Given a sorted integer array without duplicates, return the summary of its ranges.Example 1:Input: [0,1,2,4,5,7]Output: [“0->2”,“4->5”,“7”]Explanation: 0,1,2 form a continuous range;...
2019-01-01 20:12:10 135
原创 [LeetCode]-Number of Islands岛屿的数量
问题描述Given a 2d grid map of '1’s (land) and '0’s (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may a...
2019-01-01 19:55:49 131
原创 [LeetCode]-全排列问题
问题描述Given a collection of distinct integers, return all possible permutations.Example:Input: [1,2,3]Output:[1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1]完整问题描述点击这里解题思路先求n-1的全排列,然后在前一个排...
2019-01-01 19:42:42 202
原创 基于协同过滤算法构建推荐系统
推荐系统介绍推荐系统是信息过滤系统的一个子类,它根据用户的偏好和行为,来向用户呈现他(或她)可能感兴趣的物品。推荐系统会尝试去预测你对一个物品的喜好,以此向你推荐一个你很有可能会喜欢的物品。协同过滤算法介绍算法实现心得体会...
2018-12-30 12:46:00 1482
原创 【LeetCode】3Sum
问题描述Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note:The solution set must no...
2018-09-16 12:04:33 263
原创 [LeetCode]-Plus One (加1运算)
问题描述Given a non-empty array of digits representing a non-negative integer, plus one to the integer. The digits are stored such that the most significant digit is at the head of the list, and ea...
2018-09-09 11:31:50 270
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人