![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
我属码
沉迷于代码无法自拔
展开
-
LeetCode From Easy To Hard No3[Easy]: Find Anagram Mappings 异构映射
Given two listsA andB, andBis an anagram ofA.Bis an anagram ofAmeansBis made by randomizing theorder of the elements inA.We want to find anindex mappingP, fromAtoB. A mappingP[i] =...原创 2019-07-16 17:41:14 · 79 阅读 · 0 评论 -
LeetCode From Easy To Hard No8[Easy]: Squares of a Sorted Array
Given an array of integersAsorted in non-decreasing order,return an array of the squares of each number,also in sorted non-decreasing order.Example 1:Input: [-4,-1,0,3,10]Output: [0,1,9,16,1...原创 2019-08-02 11:53:30 · 112 阅读 · 0 评论 -
LeetCode From Easy To Hard No10[Easy]: Unique Email Addresses 邮件地址的唯一性
very email consists of a local name and a domain name, separated by the @ sign.For example, inalice@leetcode.com,aliceis the local name, andleetcode.comis the domain name.Besides lowercase le...原创 2019-08-06 13:17:18 · 395 阅读 · 0 评论 -
LeetCode From Easy To Hard No9[Easy]: Search in a Binary Search Tree 查找二叉树中的值
Given the root node of a binary search tree (BST) and a value. You need to find the node in the BST that the node's value equals the given value. Return the subtree rooted with that node. If such node...原创 2019-08-06 10:28:19 · 86 阅读 · 0 评论 -
LeetCode From Easy To Hard No7[Medium]: Print Zero Even Odd 按顺序打印[010203...0n]
第一次挑战Medium的题:Suppose you are given the following code:class ZeroEvenOdd { public ZeroEvenOdd(int n) { ... } // constructor public void zero(printNumber) { ... } // only output 0's pu...原创 2019-08-01 15:12:48 · 145 阅读 · 0 评论 -
LeetCode From Easy To Hard No4[Easy]: Range Sum of BST 求二叉树某个区间内的数的和
Given therootnode of a binary search tree, return the sum of values of all nodes with value betweenLandR(inclusive).The binary search tree is guaranteed to have unique values.Example 1:...原创 2019-07-24 16:54:23 · 149 阅读 · 0 评论 -
LeetCode From Easy To Hard No6[Easy]: Print in Order 按顺序执行线程
Suppose we have a class:public class Foo { public void first() { print("first"); } public void second() { print("second"); } public void third() { print("third"); }}The same instance ofFo...原创 2019-07-31 12:27:33 · 126 阅读 · 0 评论 -
LeetCode From Easy To Hard No5[Easy]: Unique Morse Code Words 独一无二的摩斯密码
International Morse Code defines a standard encoding where each letter is mapped to a series of dots and dashes, as follows:"a"maps to".-","b"maps to"-...","c"maps to"-.-.", and so on.For c...原创 2019-07-25 11:41:43 · 141 阅读 · 0 评论 -
LeetCode From Easy To Hard No1[Easy]: Two Sum
Description:Given an array of integers, returnindicesof the two numbers such that they add up to a specific target.You may assume that each input would haveexactlyone solution, and you may no...原创 2019-07-12 16:17:04 · 107 阅读 · 0 评论 -
LeetCode From Easy To Hard No2[Easy]: Jewels and Stones珠宝和石头
You're given stringsJrepresenting the types of stones that are jewels, andSrepresenting the stones you have. Each character inSis a type of stone you have. You want to know how many of the sto...原创 2019-07-16 10:49:15 · 142 阅读 · 0 评论 -
LeetCode From Easy To Hard No11[Easy]Middle of the Linked List 求链表的中间节点[快慢指针]
Given a non-empty, singlylinked list with head nodehead, returnamiddle node of linked list.If there are two middle nodes, return the second middle node.Example 1:Input: [1,2,3,4,5]Outpu...原创 2019-08-21 15:19:04 · 183 阅读 · 0 评论