Sara

  • Home

  • Tags

  • Categories

  • Archives

  • Search

LeetCode_Different Ways to Add Parentheses

Posted on 2019-06-24 | In LeetCode

Different Ways to Add Parentheses

Given a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. The valid operators are +, - and *.
(不同的加括号方式使得运算结果不一致)

Read more »

LeetCode_Sliding Window Maximum

Posted on 2019-06-21 | In LeetCode

Sliding Window Maximum

Given an array 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 time the sliding window moves right by one position. Return the max sliding window.
(寻找大小为 k 的滑动窗口中的最大值)

Read more »

LeetCode_Summary Ranges

Posted on 2019-06-21 | In LeetCode

Summary Ranges

Given a sorted integer array without duplicates, return the summary of its ranges.
(将数组中连续的范围合并)

Read more »

LeetCode_Combination Sum III

Posted on 2019-06-06 | Edited on 2019-06-15 | In LeetCode

Combination Sum III

Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each combination should be a unique set of numbers.
(从1-9中选取k个数的和为n)

Read more »

LeetCode_Kth Largest Element in an Array

Posted on 2019-06-05 | In LeetCode

Kth Largest Element in an Array

Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.
(数组定位第k大的元素)

Read more »

LeetCode_Shortest Palindrome

Posted on 2019-06-05 | In LeetCode

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 find by performing this transformation.
(在字符串前面增加字符使其为回文序列)

Read more »

LeetCode_House Robber II

Posted on 2019-06-05 | In LeetCode

House Robber II

You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed. All houses at this place are arranged in a circle. That means the first house is the neighbor of the last one. Meanwhile, adjacent houses have security system connected and it will automatically contact the police if two adjacent houses were broken into on the same night.

Given a list of non-negative integers representing the amount of money of each house, determine the maximum amount of money you can rob tonight without alerting the police.
(圆环数组中不相邻数组成的和最大)

Read more »

LeetCode_Word Search II

Posted on 2019-06-05 | In LeetCode

Word Search II

Given a 2D board and a list of words from the dictionary, find all words in the board. Each word must be constructed from letters of sequentially adjacent cell, where “adjacent” cells are those horizontally or vertically neighboring. The same letter cell may not be used more than once in a word.
(矩阵中进行一组词语搜索)

Read more »

LeetCode_Add and Search Word - Data structure design

Posted on 2019-06-03

Add and Search Word - Data structure design

Design a data structure that supports the following two operations. search(word) can search a literal word or a regular expression string containing only letters a-z or .. . means it can represent any one letter.
(设计一种数据结构支持正则查询)

1
2
void addWord(word)
bool search(word)
Read more »

LeetCode_Course Schedule II

Posted on 2019-06-03 | In LeetCode

Course Schedule II

There are a total of n courses you have to take, labeled from 0 to n-1. Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as a pair: [0,1]. Given the total number of courses and a list of prerequisite pairs, return the ordering of courses you should take to finish all courses. There may be multiple correct orders, you just need to return one of them. If it is impossible to finish all courses, return an empty array.
(课程清单,给出具体的结果)

Read more »
123…21

Sara Han

207 posts
4 categories
40 tags
© 2019 Sara Han
Powered by Hexo v3.8.0
|
Theme – NexT.Mist v6.4.2