- 博客(26)
- 资源 (1)
- 收藏
- 关注
原创 127. Word Ladder
https://leetcode.com/problems/word-ladder/Given two words (beginWordandendWord), and a dictionary's word list, find the length of shortest transformation sequence frombeginWordtoendWord, such that:Only one letter can be changed at a time. Each tr...
2020-07-26 22:14:01 70
原创 1218. Longest Arithmetic Subsequence of Given Difference
https://leetcode.com/problems/longest-arithmetic-subsequence-of-given-difference/Given an integer arrayarrand an integerdifference, return the length of the longest subsequence inarrwhich is an arithmetic sequence such that the difference between ad...
2020-07-26 02:22:56 116
原创 724. Find Pivot Index
https://leetcode.com/problems/find-pivot-index/Given an array of integersnums, write a method that returns the "pivot" index of this array.We define the pivot index as the index where the sum of all the numbers to the left of the index is equal to the.
2020-07-26 01:38:48 80
原创 1278. Palindrome Partitioning III
Given asetof candidate numbers (candidates)(without duplicates)and a target number (target), find all unique combinations incandidateswhere the candidate numbers sums totarget.Thesamerepeated number may be chosen fromcandidatesunlimited number...
2020-07-24 02:21:44 110
原创 Android Studio 4.0 版本编译提示的中文乱码问题
问题截图解决方法按照AS的安装路径找到studio64.exe.vmoptions 和studio.exe.vmoptions我的路径更改过(标记为红色),安装路径是:C:\softwares\Android\Android Studio\bin使用记事本或者其他文本工具打开,然后添加-Dfile.encoding=UTF-8,保存,重启AS即可。 结果...
2020-07-23 23:46:48 821
原创 一个安卓project的项目结构简介
Android系统架构1、Linux内核层 Android系统基于Linux内核的,这一层为Android设备的各种硬件提供了底层的驱动,如显示驱动、音频驱动、照相机驱动、蓝牙驱动等。2、系统运行库层 这一层通过一些C/C++库来为Android系统提供了主要的特性支持。如SQLite库提供了数据库的支持等。3、应用框架层 这一层主要提供了构建应用程序可能用到的各种API,Android自带的一些核心应用就是使用这些API完成的,开发者可以通过这些...
2020-07-22 21:23:48 1015
原创 124. Binary Tree Maximum Path Sum
https://leetcode.com/problems/binary-tree-maximum-path-sum/Given anon-emptybinary tree, find the maximum path sum.For this problem, a path is defined as any sequence of nodes from some starting node to any node in the tree along the parent-child conn..
2020-07-21 23:40:43 90
原创 68. Text Justification
https://leetcode.com/problems/text-justification/Given an array of words and a widthmaxWidth, format the text such that each line has exactlymaxWidthcharacters and is fully (left and right) justified.You should pack your words in a greedy approach; ...
2020-07-20 01:36:25 85
原创 494. Target Sum
https://leetcode.com/problems/target-sum/You 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 out how many ways to a...
2020-07-18 02:14:36 77
原创 329. Longest Increasing Path in a Matrix
https://leetcode.com/problems/longest-increasing-path-in-a-matrix/Given an integer matrix, find the length of the longest increasing path.From each cell, you can either move to four directions: left, right, up or down. You may NOT move diagonally or mo
2020-07-17 23:16:46 70
原创 1161. Maximum Level Sum of a Binary Tree
https://leetcode.com/problems/maximum-level-sum-of-a-binary-tree/Given therootof a binary tree, the level of its root is1,the level of its children is2,and so on.Return thesmallestlevelXsuch that the sum of all the values of nodes at levelX...
2020-07-17 19:48:03 125
原创 1306. Jump Game III
https://leetcode.com/problems/jump-game-iii/Given an array of non-negative integersarr, you are initially positioned atstartindex of the array. When you are at indexi, you can jumptoi + arr[i]ori - arr[i], check if you can reach toanyindex with...
2020-07-17 17:50:53 65
原创 1042. Flower Planting With No Adjacent
You haveNgardens, labelled1toN. In each garden, you want to plant one of 4 types of flowers.paths[i] = [x, y]describes the existence of a bidirectional path from gardenxto gardeny.Also, there is no garden that has more than 3 paths coming int...
2020-07-16 02:04:57 133
原创 997. Find the Town Judge
https://leetcode.com/problems/find-the-town-judge/In a town, there areNpeople labelled from1toN. There is a rumor that one of these people is secretly the town judge.If thetown judge exists, then:The town judge trusts nobody. Everybody (excep...
2020-07-14 02:05:57 82
原创 322. Coin Change
https://leetcode.com/problems/coin-change/You are given coins of different denominations and a total amount of moneyamount. Write a function to compute the fewest number of coins that you need to make up that amount. If that amount of money cannot be ma.
2020-07-12 19:59:50 100
原创 474. Ones and Zeroes
https://leetcode.com/problems/ones-and-zeroes/Given an array,strs, with strings consisting of only0sand1s. Also two integersmandn.Now your task is to find the maximum number of strings that you can form with givenm0sandn1s. Each0and1can...
2020-07-12 03:55:41 94
原创 413. Arithmetic Slices
https://leetcode.com/problems/arithmetic-slices/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 same.For example, these are arithmetic sequences:1
2020-07-09 17:37:56 71
原创 115. Distinct Subsequences
https://leetcode.com/problems/distinct-subsequences/Given a stringSand a stringT, count the number of distinct subsequences ofSwhich equalsT.A subsequence of a string is a new string which is formed from the original string by deleting some (can ...
2020-07-09 03:28:46 68
原创 117. Populating Next Right Pointers in Each Node II
https://leetcode.com/problems/populating-next-right-pointers-in-each-node-ii/Given a binary treestruct Node { int val; Node *left; Node *right; Node *next;}Populate each next pointer to point to its next right node. If there is no next rig
2020-07-09 01:38:45 86
原创 116. Populating Next Right Pointers in Each Node
https://leetcode.com/problems/populating-next-right-pointers-in-each-node/You are given aperfect binary treewhereall leaves are on the same level, and every parent has two children. The binary tree has the following definition:struct Node { int v...
2020-07-09 01:19:45 106
原创 91. Decode Ways
https://leetcode.com/problems/decode-ways/A message containing letters fromA-Zis being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given anon-emptystring containing only digits, determine the total num...
2020-07-07 01:50:30 76
原创 99. Recover Binary Search Tree
https://leetcode.com/problems/recover-binary-search-tree/Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Example 1:Input: [1,3,null,null,2] 1 /3 \ 2Output: [3,1,null,...
2020-07-05 22:55:02 74
原创 106. Construct Binary Tree from Inorder and Postorder Traversal
https://leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal/Given inorder and postorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.For example, givenino
2020-07-05 16:11:53 219
原创 105. Construct Binary Tree from Preorder and Inorder Traversal
https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/Given preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.For example, givenpreor
2020-07-05 15:43:21 77
原创 95. Unique Binary Search Trees II
https://leetcode.com/problems/unique-binary-search-trees-ii/Given an integern, generate all structurally uniqueBST's(binary search trees) that store values 1 ...n.Example:Input: 3Output:[ [1,null,3,2], [3,2,null,1], [3,1,null,null,2], ...
2020-07-05 14:48:39 81
原创 线程的并发协作:生产者消费者模式(管程法与信号灯法)
线程的并发协作协作:生产者消费者模式应用场景:生产者消费者问题1、假设仓库只能存放一件产品,生产者将生产出来的产品放入仓库,消费者将仓库中的产品取走消费2、如果仓库没有产品,则生产者将产品放入仓库,否则停止生产并等待,知道仓库中的产品被消费者取走为止3、如果仓库中放有产品,则消费者可以将产品取走消费,否则停止消费并等待,直到仓库中再次放入产品为止分析:这是一个线程同步问题,生产者消费者共享同一个资源,并且消费者生产者之间相互依赖,互为条件1、对于生产者,没有生产产品之前,要通知消费者等待;而生
2020-07-01 22:57:55 223
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人