- 博客(33)
- 资源 (3)
- 收藏
- 关注
原创 leetcode-238. Product of Array Except Self
238. Product of Array Except SelfGiven an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of nums except nums[
2017-11-29 20:38:29 338
原创 leetcode- 442. Find All Duplicates in an Array
442. Find All Duplicates in an ArrayGiven an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once.Find all the elements that appear twice in t
2017-11-27 12:44:43 364
原创 leetcode-100. Same Tree
100. Same TreeGiven two binary trees, write a function to check if they are the same or not.Two binary trees are considered the same if they are structurally identical and the nodes have the
2017-11-26 12:56:52 350
原创 leetcode-530. Minimum Absolute Difference in BST
530. Minimum Absolute Difference in BSTGiven a binary search tree with non-negative values, find the minimum absolute difference between values of any two nodes.Example:Input: 1
2017-11-25 10:45:32 223
原创 leetcode-728. Self Dividing Numbers
728. Self Dividing NumbersA self-dividing number is a number that is divisible by every digit it contains.For example, 128 is a self-dividing number because 128 % 1 == 0, 128 % 2 == 0, a
2017-11-24 16:57:14 1698
原创 gns3使用简要教程(gns3-wireshark捕获教程)
1.安装可以去官网去下载:官网也可以去:CSDN下载链接安装的过程中附加选项可以都选,会安装wireshark,solarwinds等等,如果已经安装,可以根据提示取消。2.安装ios安装完抽后,打开软件会出 网络选择,取消就行。然后就需要安装ios,可以去这个网址下载:ios下载具体的安装步骤:ios安装教程3.测试所有安装完成后,就可以进行基
2017-11-24 16:11:30 26308
原创 leetcode-387. First Unique Character in a String
387. First Unique Character in a StringGiven a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1.Examples:s = "leetcode"return 0
2017-11-22 18:42:21 589
原创 VMware 虚拟机开机黑屏
前一段时间电脑上的虚拟机打不开了,点击开机就一直黑屏,挂起时能够看到显示,但是开机就黑屏。百度了之后找到了解决方案:(我是第一种方案就解决了)(据说可能是wegame的锅。。。)方法1:命令行窗口cmd—输入netsh winsock reset,然后重启计算机。方法2:`VM->Settings->Hardware->Display`在右面...
2017-11-21 16:19:52 119822 62
原创 leetcode-167. Two Sum II - Input array is sorted
167. Two Sum II - Input array is sortedGiven an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number.The function two
2017-11-21 15:35:36 385
原创 leetcode-169. Majority Element
leetcode-169. Majority Element Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume that the array is non-e
2017-11-21 09:00:11 273
原创 leetcode-455. Assign Cookies
455. Assign CookiesAssume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a greed factor gi, which i
2017-11-20 19:38:58 846
原创 Python-函数其他(学习笔记4)
Python-切片,迭代切片对于list和tuple来说,可能有事需要获得他们的子串,而Java等都提供了类似subString()的方法来获取子串,而对于Python来说则有一种方法叫 切片 例如: L = ['michel','Sarah','Bob','Tom'] 想要获取L的前2个元素怎么办? 当然也可以使用for循环,但是这样太麻烦了。>>>L[0:3]['michel','Sa
2017-11-20 16:21:35 194
原创 Python学习笔记说明
Python学习笔记说明所有的Python学习笔记都是我在学习廖雪峰的官方网站中的Python教程过程中记录下来的,所以大部分内容会与廖大大教程中的内容相重合,我只是想自己再写一遍,加深印象,作为记录,以便日后复习。 如果大家想学习Python,可以去廖大大的网站。 最后感谢廖大大的无私奉献
2017-11-19 09:34:34 243
原创 Python-函数(学习笔记3)
Python-函数函数定义python中的定义函数使用 def ,依次写出函数名,参数和冒号: ,在缩进块中写函数体,return返回值 例:def my_abs(x): if x >= 0: return x else: return -xpass 语句表示什么都不做,实际上当一个方法没想法怎么写时,就可用 pass 暂时代替if age >= 1
2017-11-19 09:21:57 661
原创 Python-dict和set(学习笔记2)
Python-dict 和 setdictPython内置了字典:dict的支持,dict全称dictionary,在其他语言中也称为map,使用键-值(key-value)存储 定义格式:>>>dic = {'Miachel':95,'Bob':75,'Tracy':85}>>>dic['Bob']75如果如果key不存在,dic就会报错:>>> dic['Thomas']Tracebac
2017-11-18 16:58:57 270
原创 Python学习笔记1-List,tuple
Python学习笔记-1ListPython内置的一种数据类型是列表:list。list是一种有序的集合,可以随时添加和删除其中的元素。 定义格式:classmates = ['ichel','Bob','Tom']可以用 len() 来获取 list 的长度>>>len(classmates)3可使用索引来访问元素,其中-1表示最后一个元素,-2表示倒数第二个元素,以此类推>>>classma
2017-11-18 16:06:32 175
原创 leetcode-563. Binary Tree Tilt
563. Binary Tree TiltGiven a binary tree, return the tilt of the whole tree.The tilt of a tree node is defined as the absolute difference between the sum of all left subtree node values and
2017-11-18 10:53:54 210
原创 leetcode-404. Sum of Left Leaves
404. Sum of Left LeavesFind the sum of all left leaves in a given binary tree.Example: 3 / \ 9 20 / \ 15 7There are two left leaves in the binary tree, with values 9 a
2017-11-17 11:31:27 163
原创 leetcode-383. Ransom Note
383. Ransom NoteGiven an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the ransom note can be constructed
2017-11-16 22:56:11 162
原创 leetcode-349. Intersection of Two Arrays
349. Intersection of Two ArraysGiven two arrays, write a function to compute their intersection.Example:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2].Note:Each element
2017-11-15 17:32:04 197
原创 leetcode-453. Minimum Moves to Equal Array Elements
453. Minimum Moves to Equal Array ElementsGiven a non-empty integer array of size n, find the minimum number of moves required to make all array elements equal, where a move is incrementing n -
2017-11-12 10:28:18 177
原创 leetcode-697. Degree of an Array
697. Degree of an ArrayGiven a non-empty array of non-negative integers nums, the degree of this array is defined as the maximum frequency of any one of its elements.Your task is to find t
2017-11-11 15:52:32 506
原创 leetcode-598. Range Addition II
598. Range Addition IIGiven an m * n matrix M initialized with all 0's and several update operations.Operations are represented by a 2D array, and each operation is represented by an array with
2017-11-09 17:00:59 227
原创 leetcode-492. Construct the Rectangle
492. Construct the RectangleFor a web developer, it is very important to know how to design a web page's size. So, given a specific rectangular web page’s area, your job by now is to design a re
2017-11-08 17:30:15 174
原创 Java之Private,public,protect,default的权限
1.仅对本类可见-private2.对所有类可见-public3.对本包和所有子类可见 -protected4.对本包可见-default(不需要修饰符) PrivateDefaultProtectedPublic同一个类111
2017-11-07 19:57:08 598
转载 Java修饰符 abstract,static,final 的区别详解
本文转自http://www.jb51.net/article/41430.htm是我看过的介绍这些关键字比较好的文章了,所以分享一下—————————————————————————————————————————————————————————————————————————————static 表示静态,它可以修饰属性,方法和代码块。1.static修饰属性(类变
2017-11-07 19:16:45 286
原创 LeetCode-538. Convert BST to Greater Tree
538. Convert BST to Greater TreeGiven a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus sum of all keys greater
2017-11-07 11:44:53 169
原创 leetcode-606. Construct String from Binary Tree
606. Construct String from Binary TreeYou need to construct a string consists of parenthesis and integers from a binary tree with the preorder traversing way.The null node needs to be repres
2017-11-06 17:19:29 179
原创 LeetCode-283. Move Zeroes
283. Move ZeroesGiven an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements.For example, given nums = [0, 1, 0, 3,
2017-11-05 19:56:05 145
原创 LeetCode-653. Two Sum IV - Input is a BST
653. Two Sum IV - Input is a BSTGiven a Binary Search Tree and a target number, return true if there exist two elements in the BST such that their sum is equal to the given target.Example 1:
2017-11-04 21:41:06 178
原创 leetcode-389. Find the Difference
389. Find the DifferencGiven two strings s and t which consist of only lowercase letters.String t is generated by random shuffling string s and then add one more letter at a random positio
2017-11-03 11:23:18 164
原创 leetcode-448. Find All Numbers Disappeared in an Array
448. Find All Numbers Disappeared in an ArrayGiven an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once.Find all the elements of [1,
2017-11-02 15:05:41 142
原创 leetcode-696. Count Binary Substrings
696. Count Binary SubstringsGive a string s, count the number of non-empty (contiguous) substrings that have the same number of 0's and 1's, and all the 0's and all the 1's in these substrings
2017-11-01 18:03:41 784
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人