- 博客(251)
- 资源 (1)
- 收藏
- 关注
原创 计算机组成原理
文章目录计算机的基本硬件组成计算机性能提升性能计算机指令计算机的基本硬件组成三大基本部分:CPU、内存、主板芯片组和总线实现CPU和内存之间的通信显卡里有GPU南桥芯片组实现CPU和IO设备的通信冯·诺依曼体系结构,即存储程序计算机,最初设计的报告被特称为First Draft,需要处理器单元(计算)、控制器单元(流程)、内存、输入输出计算机性能响应时间、吞吐率计算机的计时...
2020-01-20 21:04:34
1017
原创 [LeetCode]Maximum Subarray Sum with One Deletion@Golang
Maximum Subarray Sum with One DeletionGiven an array of integers, return the maximum sum for a non-empty subarray (contiguous elements) with at most one element deletion. In other words, you want to ...
2019-11-12 22:48:28
485
原创 [LeetCode]Number of Dice Rolls With Target Sum@Golang
Number of Dice Rolls With Target SumYou have d dice, and each die has f faces numbered 1, 2, …, f.Return the number of possible ways (out of fd total ways) modulo 10^9 + 7 to roll the dice so the su...
2019-11-12 22:12:21
358
原创 [LeetCode]Longest Common Subsequence@Golang
Longest Common SubsequenceGiven two strings text1 and text2, return the length of their longest common subsequence.A subsequence of a string is a new string generated from the original string with s...
2019-11-08 09:06:36
334
原创 [LeetCode]Stone Game II@Golang
Stone Game IIAlex and Lee continue their games with piles of stones. There are a number of piles arranged in a row, and each pile has a positive integer number of stones piles[i]. The objective of ...
2019-11-06 22:24:05
249
原创 [LeetCode]Largest 1-Bordered Square@Golang
Largest 1-Bordered SquareGiven a 2D grid of 0s and 1s, return the number of elements in the largest square subgrid that has all 1s on its border, or 0 if such a subgrid doesn’t exist in the grid.Exa...
2019-11-06 16:14:20
170
原创 [LeetCode]Minimum Cost Tree From Leaf Values@Golang
Minimum Cost Tree From Leaf ValuesGiven an array arr of positive integers, consider all binary trees such that:Each node has either 0 or 2 children;The values of arr correspond to the values of eac...
2019-11-05 16:35:58
195
原创 [LeetCode]Filling Bookcase Shelves@Golang
Filling Bookcase ShelvesWe have a sequence of books: the i-th book has thickness books[i][0] and height books[i][1].We want to place these books in order onto bookcase shelves that have total width ...
2019-11-02 00:06:40
198
原创 [LeetCode]Last Stone Weight II@Golang
Last Stone Weight IIWe have a collection of rocks, each rock has a positive integer weight.Each turn, we choose any two rocks and smash them together. Suppose the stones have weights x and y with x...
2019-10-31 23:34:16
260
原创 [LeetCode]Longest String Chain@Golang
Longest String ChainGiven a list of words, each word consists of English lowercase letters.Let’s say word1 is a predecessor of word2 if and only if we can add exactly one letter anywhere in word1 to...
2019-10-30 23:56:05
162
原创 [LeetCode]Longest Arithmetic Sequence@Golang
Longest Arithmetic SequenceGiven an array A of integers, return the length of the longest arithmetic subsequence in A.Recall that a subsequence of A is a list A[i_1], A[i_2], …, A[i_k] with 0 <= ...
2019-10-29 23:29:21
145
原创 [LeetCode]Video Stitching@Golang
Video StitchingYou are given a series of video clips from a sporting event that lasted T seconds. These video clips can be overlapping with each other and have varied lengths.Each video clip clips[...
2019-10-21 18:40:59
182
原创 [LeetCode]Minimum Cost For Tickets@Golang
Minimum Cost For TicketsIn a country popular for train travel, you have planned some train travelling one year in advance. The days of the year that you will travel is given as an array days. Each ...
2019-10-21 11:26:03
171
原创 [LeetCode]Longest Turbulent Subarray@Golang
Longest Turbulent SubarrayA subarray A[i], A[i+1], …, A[j] of A is said to be turbulent if and only if:For i <= k < j, A[k] > A[k+1] when k is odd, and A[k] < A[k+1] when k is even;OR, ...
2019-10-17 15:33:33
169
原创 [LeetCode]Numbers With Same Consecutive Differences@Golang
Numbers With Same Consecutive DifferencesReturn all non-negative integers of length N such that the absolute difference between every two consecutive digits is K.Note that every number in the answer...
2019-10-16 22:37:54
220
原创 [LeetCode]Minimum Falling Path Sum@Golang
Minimum Falling Path SumGiven a square array of integers A, we want the minimum sum of a falling path through A.A falling path starts at any element in the first row, and chooses one element from ea...
2019-10-15 11:21:41
135
原创 [LeetCode]Bitwise ORs of Subarrays@Golang
Bitwise ORs of SubarraysWe have an array A of non-negative integers.For every (contiguous) subarray B = [A[i], A[i+1], …, A[j]] (with i <= j), we take the bitwise OR of all the elements in B, obt...
2019-10-14 11:27:47
151
原创 [LeetCode]Push Dominoes@Golang
Push DominoesThere are N dominoes in a line, and we place each domino vertically upright.In the beginning, we simultaneously push some of the dominoes either to the left or to the right.After each ...
2019-10-10 22:00:29
169
原创 [LeetCode]Length of Longest Fibonacci Subsequence@Golang
Length of Longest Fibonacci SubsequenceA sequence X_1, X_2, …, X_n is fibonacci-like if:n >= 3X_i + X_{i+1} = X_{i+2} for all i + 2 <= nGiven a strictly increasing array A of positive intege...
2019-10-10 11:09:42
143
原创 [LeetCode]Largest Sum of Averages@Python
Largest Sum of AveragesWe partition a row of numbers A into at most K adjacent (non-empty) groups, then our score is the sum of the average of each group. What is the largest score we can achieve?No...
2019-09-26 15:45:17
201
原创 [LeetCode]Minimum Swaps To Make Sequences Increasing@Python
Minimum Swaps To Make Sequences IncreasingWe have two integer sequences A and B of the same non-zero length.We are allowed to swap elements A[i] and B[i]. Note that both elements are in the same in...
2019-09-25 15:15:31
143
原创 [LeetCode]Min Cost Climbing Stairs@Python
Min Cost Climbing StairsOn a staircase, the i-th step has some non-negative cost cost[i] assigned (0 indexed).Once you pay the cost, you can either climb one or two steps. You need to find minimum c...
2019-09-19 14:08:48
231
原创 [LeetCode]Maximum Length of Repeated Subarray@Python
Maximum Length of Repeated SubarrayGiven two integer arrays A and B, return the maximum length of an subarray that appears in both arrays.ExampleInput:A: [1,2,3,2,1]B: [3,2,1,4,7]Output: 3Expl...
2019-09-19 13:42:19
96
原创 [LeetCode]Minimum ASCII Delete Sum for Two Strings@Python
Minimum ASCII Delete Sum for Two StringsGiven two strings s1, s2, find the lowest ASCII sum of deleted characters to make two strings equal.ExampleInput: s1 = “sea”, s2 = “eat”Output: 231Explana...
2019-09-18 15:55:19
133
原创 [LeetCode]Partition to K Equal Sum Subsets@Python
Partition to K Equal Sum SubsetsGiven an array of integers nums and a positive integer k, find whether it’s possible to divide this array into k non-empty subsets whose sums are all equal.ExampleI...
2019-09-17 14:42:32
213
原创 [LeetCode]Knight Probability in Chessboard@Python
Knight Probability in ChessboardOn an NxN chessboard, a knight starts at the r-th row and c-th column and attempts to make exactly K moves. The rows and columns are 0 indexed, so the top-left square ...
2019-09-17 10:41:00
132
原创 [LeetCode]Number of Longest Increasing Subsequence@Python
Number of Longest Increasing SubsequenceGiven an unsorted array of integers, find the number of longest increasing subsequence.ExampleInput: [1,3,5,4,7]Output: 2Explanation: The two longest in...
2019-09-12 11:38:06
88
原创 [LeetCode]2 Keys Keyboard@Python
2 Keys KeyboardInitially on a notepad only one character ‘A’ is present. You can perform two operations on this notepad for each step:Copy All: You can copy all the characters present on the notepa...
2019-09-11 15:19:47
107
原创 [LeetCode]Palindromic Substrings@Python
Palindromic SubstringsGiven a string, your task is to count how many palindromic substrings in this string.The substrings with different start indexes or end indexes are counted as different substr...
2019-09-06 15:16:23
130
原创 [Leetcode]Maximum Length of Pair Chain@Python
Maximum Length of Pair ChainYou are given n pairs of numbers. In every pair, the first number is always smaller than the second number.Now, we define a pair (c, d) can follow another pair (a, b) if...
2019-09-05 16:39:39
128
原创 [LeetCode]Longest Palindromic Subsequence@Python
Longest Palindromic SubsequenceGiven a string s, find the longest palindromic subsequence’s length in s. You may assume that the maximum length of s is 1000.ExampleInput:“cbbd”Output:2One possi...
2019-07-31 11:00:17
189
原创 [LeetCode]Target Sum@Python
Target SumYou are given a list of non-negative integers, a1, a2, …, an, and a target, S. Now you have 2 symbols + and -. For each integer, you should choose one from + and - as its new symbol.Find o...
2019-07-30 20:58:04
243
原创 [LeetCode]Predict the Winner@Python
Predict the WinnerGiven an array of scores that are non-negative integers. Player 1 picks one of the numbers from either end of the array followed by the player 2 and then player 1 and so on. Each ti...
2019-07-29 10:07:54
194
原创 [LeetCode]Unique Substrings in Wraparound String@Python
Unique Substrings in Wraparound StringConsider the string s to be the infinite wraparound string of “abcdefghijklmnopqrstuvwxyz”, so s will look like this: “…zabcdefghijklmnopqrstuvwxyzabcdefghijklmn...
2019-07-26 16:28:12
168
原创 [LeetCode]Can I Win@Python
Can I WinIn the “100 game,” two players take turns adding, to a running total, any integer from 1…10. The player who first causes the running total to reach or exceed 100 wins.What if we change the ...
2019-07-25 15:30:16
151
原创 [LeetCode]Partition Equal Subset Sum@Python
Partition Equal Subset SumGiven a non-empty array containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elements in both subsets is equal.Note...
2019-07-24 10:51:52
137
原创 [LeetCode]Arithmetic Slices@Python
Arithmetic SlicesA sequence of number is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the same.ExampleA = [1, 2, 3, 4]r...
2019-07-23 15:59:29
165
原创 [LeetCode]Combination Sum IV@Python
Combination Sum IVGiven an integer array with all positive numbers and no duplicates, find the number of possible combinations that add up to a positive integer target.Examplenums = [1, 2, 3]targe...
2019-07-22 10:33:53
149
原创 [LeetCode]Largest Divisible Subset@Python
Largest Divisible SubsetGiven a set of distinct positive integers, find the largest subset such that every pair (Si, Sj) of elements in this subset satisfies:Si % Sj = 0 or Sj % Si = 0.If there are...
2019-07-19 16:09:46
167
原创 [LeetCode]Integer Break@Python
Integer BreakGiven 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.ExampleInput: 10...
2019-07-18 10:07:32
126
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人