自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(90)
  • 收藏
  • 关注

原创 661. Image Smoother*

661. Image Smoother*https://leetcode.com/problems/image-smoother/题目描述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 eac...

2019-12-31 21:59:00 191 1

原创 1010. Pairs of Songs With Total Durations Divisible by 60*

1010. Pairs of Songs With Total Durations Divisible by 60*https://leetcode.com/problems/pairs-of-songs-with-total-durations-divisible-by-60/题目描述In a list of songs, the i-th song has a duration of t...

2019-12-31 21:48:04 343

原创 1018. Binary Prefix Divisible By 5*

1018. Binary Prefix Divisible By 5 Easy*https://leetcode.com/problems/binary-prefix-divisible-by-5/题目描述Given an array A of 0s and 1s, consider N_i: the i-th subarray from A[0] to A[i] interpreted a...

2019-12-31 21:13:13 261

原创 628. Maximum Product of Three Numbers*

628. Maximum Product of Three Numbers*https://leetcode.com/problems/maximum-product-of-three-numbers/题目描述Given an integer array, find three numbers whose product is maximum and output the maximum p...

2019-12-31 20:41:04 247

原创 1232. Check If It Is a Straight Line*

1232. Check If It Is a Straight Line*https://leetcode.com/problems/check-if-it-is-a-straight-line/submissions/题目描述检查一系列坐标点是否在同一直线上.C++ 实现 1看斜率是否一致. 使用乘法比较.class Solution {private: bool isIn...

2019-12-31 13:35:12 302

原创 121. Best Time to Buy and Sell Stock*

121. Best Time to Buy and Sell Stock*https://leetcode.com/problems/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.If you...

2019-12-31 13:17:40 246

原创 717. 1-bit and 2-bit Characters*

717. 1-bit and 2-bit Characters*https://leetcode.com/problems/1-bit-and-2-bit-characters/题目描述We have two special characters. The first character can be represented by one bit 0. The second characte...

2019-12-31 13:05:01 177

原创 122. Best Time to Buy and Sell Stock II*

122. Best Time to Buy and Sell Stock II*https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/题目描述Say you have an array for which the ith element is the price of a given stock on day i....

2019-12-31 12:43:24 197

原创 217. Contains Duplicate*

217. Contains Duplicate*https://leetcode.com/problems/contains-duplicate/题目描述给定一个数组, 判断是否存在重复值.C++ 实现 1class Solution {public: bool containsDuplicate(vector<int>& nums) { u...

2019-12-31 10:01:04 215

原创 766. Toeplitz Matrix*

766. Toeplitz Matrix*https://leetcode.com/problems/toeplitz-matrix/题目描述A matrix is Toeplitz if every diagonal from top-left to bottom-right has the same element.Now given an M x N matrix, return T...

2019-12-31 09:55:06 186

原创 867. Transpose Matrix*

867. Transpose Matrix*https://leetcode.com/problems/transpose-matrix/题目描述Given a matrix A, return the transpose of A.The transpose of a matrix is the matrix flipped over it’s main diagonal, switch...

2019-12-30 23:01:09 229

原创 1299. Replace Elements with Greatest Element on Right Side*

1299. Replace Elements with Greatest Element on Right Side*https://leetcode.com/problems/replace-elements-with-greatest-element-on-right-side/题目描述Given an array arr, replace every element in that a...

2019-12-30 22:49:02 376

原创 1304. Find N Unique Integers Sum up to Zero*

1304. Find N Unique Integers Sum up to Zero*https://leetcode.com/problems/find-n-unique-integers-sum-up-to-zero/题目描述Given an integer n, return any array containing n unique integers such that they ...

2019-12-30 22:30:04 522

原创 1170. Compare Strings by Frequency of the Smallest Character*

1170. Compare Strings by Frequency of the Smallest Character*https://leetcode.com/problems/compare-strings-by-frequency-of-the-smallest-character/题目描述Let’s define a function f(s) over a non-empty s...

2019-12-30 22:19:18 325

原创 888. Fair Candy Swap*

888. Fair Candy Swap*https://leetcode.com/problems/fair-candy-swap/题目描述Alice and Bob have candy bars of different sizes: A[i] is the size of the i-th bar of candy that Alice has, and B[j] is the si...

2019-12-29 17:15:17 221

原创 1013. Partition Array Into Three Parts With Equal Sum*

1013. Partition Array Into Three Parts With Equal Sum*https://leetcode.com/problems/partition-array-into-three-parts-with-equal-sum/题目描述Given an array A of integers, return true if and only if we c...

2019-12-29 16:58:02 249

原创 896. Monotonic Array*

896. Monotonic Array*https://leetcode.com/problems/monotonic-array/题目描述An array is monotonic if it is either monotone increasing or monotone decreasing.An array A is monotone increasing if for all...

2019-12-29 16:30:51 192

原创 697. Degree of an Array*

697. Degree of an Array*https://leetcode.com/problems/degree-of-an-array/题目描述Given a non-empty array of non-negative integers nums, the degree of this array is defined as the maximum frequency of a...

2019-12-29 16:23:47 213

原创 1260. Shift 2D Grid*

1260. Shift 2D Grid*https://leetcode.com/problems/shift-2d-grid/题目描述Given a 2D grid of size m x n and an integer k. You need to shift the grid k times.In one shift operation:Element at grid[i][j...

2019-12-29 15:09:10 334

原创 1089. Duplicate Zeros*

1089. Duplicate Zeros*https://leetcode.com/problems/duplicate-zeros/题目描述Given a fixed length array arr of integers, duplicate each occurrence of zero, shifting the remaining elements to the right....

2019-12-28 11:26:53 778

原创 1287. Element Appearing More Than 25% In Sorted Array*

1287. Element Appearing More Than 25% In Sorted Array*https://leetcode.com/problems/element-appearing-more-than-25-in-sorted-array/题目描述Given an integer array sorted in non-decreasing order, there i...

2019-12-27 22:30:23 290

原创 985. Sum of Even Numbers After Queries*

985. Sum of Even Numbers After Queries*https://leetcode.com/problems/sum-of-even-numbers-after-queries/题目描述We have an array A of integers, and an array queries of queries.For the i-th query val = ...

2019-12-27 22:17:06 219

原创 1200. Minimum Absolute Difference*

1200. Minimum Absolute Difference*https://leetcode.com/problems/minimum-absolute-difference/题目描述Given an array of distinct integers arr, find all pairs of elements with the minimum absolute differe...

2019-12-27 09:36:32 290

原创 1002. Find Common Characters*

1002. Find Common Characters*https://leetcode.com/problems/find-common-characters/题目描述Given an array A of strings made only from lowercase letters, return a list of all characters that show up in a...

2019-12-27 07:59:49 233

原创 509. Fibonacci Number*

509. Fibonacci Number*https://leetcode.com/problems/fibonacci-number/题目描述The Fibonacci numbers, commonly denoted F(n) form a sequence, called the Fibonacci sequence, such that each number is the su...

2019-12-26 09:57:10 219

原创 1122. Relative Sort Array*

1122. Relative Sort Array*https://leetcode.com/problems/relative-sort-array/题目描述Given two arrays arr1 and arr2, the elements of arr2 are distinct, and all elements in arr2 are also in arr1.Sort th...

2019-12-26 09:49:47 229

原创 1051. Height Checker*

1051. Height Checker*https://leetcode.com/problems/height-checker/题目描述Students are asked to stand in non-decreasing order of heights for an annual photo.Return the minimum number of students not s...

2019-12-25 22:51:23 292

原创 922. Sort Array By Parity II*

922. Sort Array By Parity II*https://leetcode.com/problems/sort-array-by-parity-ii/题目描述Given an array A of non-negative integers, half of the integers in A are odd, and half of the integers are eve...

2019-12-25 10:06:49 195

原创 905. Sort Array By Parity*

905. Sort Array By Parity*https://leetcode.com/problems/sort-array-by-parity/题目描述Given an array A of non-negative integers, return an array consisting of all the even elements of A, followed by all...

2019-12-25 10:01:07 199

原创 1160. Find Words That Can Be Formed by Characters*

1160. Find Words That Can Be Formed by Characters*https://leetcode.com/problems/find-words-that-can-be-formed-by-characters/题目描述You are given an array of strings words and a string chars.A string ...

2019-12-24 10:03:57 312

原创 Pandas 初体验

Pandas 初体验pandas 主要提供了 Series 以及 DataFrame 两个数据结构来分别处理 1D 以及 2D 数据. DataFrame 的每一列都是一个 Series. 下面介绍一些 pandas 的常用方法. 库的导入遵循惯例:import pandas as pd数据读取df = pd.read_table(filepath, sep='\t', header=N...

2019-12-24 09:35:33 868

原创 1295. Find Numbers with Even Number of Digits*

1295. Find Numbers with Even Number of Digits*https://leetcode.com/problems/find-numbers-with-even-number-of-digits/题目描述Given an array nums of integers, return how many of them contain an even numb...

2019-12-23 22:46:09 803

原创 1222. Queens That Can Attack the King**

1222. Queens That Can Attack the King**https://leetcode.com/problems/queens-that-can-attack-the-king/题目描述On an 8x8 chessboard, there can be multiple Black Queens and one White King.Given an array ...

2019-12-23 22:26:21 299

原创 950. Reveal Cards In Increasing Order**

950. Reveal Cards In Increasing Order**https://leetcode.com/problems/reveal-cards-in-increasing-order/题目描述In a deck of cards, every card has a unique integer. You can order the deck in any order y...

2019-12-22 12:55:57 298

原创 1184. Distance Between Bus Stops*

1184. Distance Between Bus Stops*https://leetcode.com/problems/distance-between-bus-stops/题目描述A bus has n stops numbered from 0 to n - 1 that form a circle. We know the distance between all pairs o...

2019-12-21 19:16:11 253

原创 792. Number of Matching Subsequences**

792. Number of Matching Subsequences**https://leetcode.com/problems/number-of-matching-subsequences/description/题目描述Given string S and a dictionary of words words, find the number of words[i] that ...

2019-12-21 15:52:33 178

原创 830. Positions of Large Groups*

830. Positions of Large Groups*https://leetcode.com/problems/positions-of-large-groups/description/题目描述In a string S of lowercase letters, these letters form consecutive groups of the same characte...

2019-12-21 15:00:47 252

原创 665. Non-decreasing Array*

665. Non-decreasing Array*https://leetcode.com/problems/non-decreasing-array/description/题目描述Given an array with n integers, your task is to check if it could become non-decreasing by modifying at ...

2019-12-21 14:41:51 167

原创 373. Find K Pairs with Smallest Sums**

373. Find K Pairs with Smallest Sums**https://leetcode.com/problems/find-k-pairs-with-smallest-sums/description/题目描述You are given two integer arrays nums1 and nums2 sorted in ascending order and an...

2019-12-21 14:11:28 177

原创 747. Largest Number At Least Twice of Others*

747. Largest Number At Least Twice of Others*https://leetcode.com/problems/largest-number-at-least-twice-of-others/description/题目描述In a given integer array nums, there is always exactly one largest...

2019-12-21 14:05:18 230

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除