随笔分类 -  Algorithms

LeetCode699. Falling Squares
摘要:On an infinite number line (x-axis), we drop given squares in the order they are given. The i-th square dropped (positions[i] = (left, side_length)) i 阅读全文
posted @ 2018-10-04 15:03 f91og 阅读(384) 评论(0) 推荐(0) 编辑
LeetCode691. Stickers to Spell Word
摘要:We are given N different types of stickers. Each sticker has a lowercase English word on it. You would like to spell out the given target string by cu 阅读全文
posted @ 2018-10-02 00:47 f91og 阅读(383) 评论(0) 推荐(0) 编辑
LeetCode664. Strange Printer
摘要:There is a strange printer with the following two special requirements: Given a string consists of lower English letters only, your job is to count th 阅读全文
posted @ 2018-09-29 16:54 f91og 阅读(247) 评论(0) 推荐(0) 编辑
LeetCode517. Super Washing Machines
摘要:You have n super washing machines on a line. Initially, each washing machine has some dresses or is empty. For each move, you could choose any m (1 ≤ 阅读全文
posted @ 2018-09-29 15:45 f91og 阅读(314) 评论(0) 推荐(0) 编辑
LeetCode446. Arithmetic Slices II - Subsequence
摘要:A sequence of numbers is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the 阅读全文
posted @ 2018-09-28 23:35 f91og 阅读(332) 评论(0) 推荐(0) 编辑
LeetCode403. Frog Jump
摘要:A frog is crossing a river. The river is divided into x units and at each unit there may or may not exist a stone. The frog can jump on a stone, but i 阅读全文
posted @ 2018-09-28 21:31 f91og 阅读(264) 评论(0) 推荐(0) 编辑
LeetCode282. Expression Add Operators
摘要:Given a string that contains only digits 0-9 and a target value, return all possibilities to add binary operators (not unary) +, -, or *between the di 阅读全文
posted @ 2018-09-28 00:04 f91og 阅读(175) 评论(0) 推荐(0) 编辑
LeetCode828. Unique Letter String
摘要:https://leetcode.com/problems/unique-letter-string/description/ A character is unique in string S if it occurs exactly once in it. For example, in str 阅读全文
posted @ 2018-09-26 23:41 f91og 阅读(456) 评论(0) 推荐(0) 编辑
算法笔试题整理——升级蓄水池 && 字符串数字表达式计算值 && 求旅游完所有景点需要的最少天数 && 宝箱怪
摘要:1. 小米笔试题——升级蓄水池 题目描述: 在米兔生活的二维世界中,建造蓄水池非常简单。 一个蓄水池可以用n个坐标轴上的非负整数表示,代表区间为【0-n】范围内宽度为1的墙壁的高度。 如下图1,黑色部分是墙壁,墙壁的高度是[0,1,0,2,1,0,1,3,2,1,2,1] ,蓝色部分是蓄水的面积,可 阅读全文
posted @ 2018-09-23 00:35 f91og 阅读(1416) 评论(2) 推荐(0) 编辑
LeetCode301. Remove Invalid Parentheses
摘要:Remove the minimum number of invalid parentheses in order to make the input string valid. Return all possible results. Note: The input string may cont 阅读全文
posted @ 2018-09-18 12:16 f91og 阅读(204) 评论(0) 推荐(0) 编辑
算法刷题细节点总结
摘要:1. 关于集合 (1) 关于map 遍历map:https://www.cnblogs.com/imzhj/p/5981665.html 感觉最好记的方法是这个: 关于get方法的一个注意点: (2) set集合的增删改元素方法和List集合是一样的吗?remove方法的一个疑问 一样的,都是 ad 阅读全文
posted @ 2018-09-18 12:16 f91og 阅读(315) 评论(0) 推荐(0) 编辑
LeetCode765. Couples Holding Hands
摘要:N couples sit in 2N seats arranged in a row and want to hold hands. We want to know the minimum number of swaps so that every couple is sitting side b 阅读全文
posted @ 2018-08-28 17:11 f91og 阅读(475) 评论(0) 推荐(0) 编辑
LeetCode741. Cherry Pickup
摘要:https://leetcode.com/problems/cherry-pickup/description/ In a N x N grid representing a field of cherries, each cell is one of three possible integers 阅读全文
posted @ 2018-08-28 01:22 f91og 阅读(427) 评论(0) 推荐(0) 编辑
LeetCode312. Burst Balloons
摘要:Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all the balloon 阅读全文
posted @ 2018-08-21 02:15 f91og 阅读(280) 评论(0) 推荐(0) 编辑
LeetCode679. 24 Game
摘要:You have 4 cards each containing a number from 1 to 9. You need to judge whether they could operated through *, /, +, -, (, ) to get the value of 24. 阅读全文
posted @ 2018-08-20 00:42 f91og 阅读(232) 评论(0) 推荐(0) 编辑
LeetCode862. Shortest Subarray with Sum at Least K
摘要:Return the length of the shortest, non-empty, contiguous subarray of A with sum at least K. If there is no non-empty subarray with sum at least K, ret 阅读全文
posted @ 2018-08-18 15:30 f91og 阅读(1242) 评论(0) 推荐(0) 编辑
LeetCode818. Race Car
摘要:https://leetcode.com/problems/race-car/description/ Your car starts at position 0 and speed +1 on an infinite number line. (Your car can go into negat 阅读全文
posted @ 2018-08-17 01:03 f91og 阅读(732) 评论(0) 推荐(0) 编辑
LeetCode解题报告—— Best Time to Buy and Sell Stock
摘要:Best Time to Buy and Sell Stock Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find th 阅读全文
posted @ 2018-08-15 01:33 f91og 阅读(251) 评论(0) 推荐(0) 编辑
LeetCode218. The Skyline Problem
摘要:https://leetcode.com/problems/the-skyline-problem/description/ A city's skyline is the outer contour of the silhouette formed by all the buildings in 阅读全文
posted @ 2018-08-15 00:32 f91og 阅读(258) 评论(0) 推荐(0) 编辑
LeetCode214. Shortest Palindrome
摘要:Given a string s, you are allowed to convert it to a palindrome by adding characters in front of it. Find and return the shortest palindrome you can f 阅读全文
posted @ 2018-08-14 14:28 f91og 阅读(148) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示