【leetcode】26. Remove Duplicates from Sorted Array

Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length. Do not allocate extra s...

2019-04-01 21:23:34

阅读数 25

评论数 0

【leetcode】14. Longest Common Prefix

Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "&q...

2019-04-01 18:08:47

阅读数 21

评论数 0

【leetcode】13. Roman to Integer-levle:simple


2019-03-30 21:42:17

阅读数 13

评论数 0

【记录】tensorflow报错DLL load failed:找不到指定程序

更新anoconda后出现了版本不兼容情况,keras不能正常使用,更新了tensorflow后测试报错如下: 解决方法如提示:protobuf 这个库版本不兼容,按搜索到的方法将重新安装指定版本即可。命令如下: pip install protobuf==3.6.0 总结:在网上搜索...

2018-09-25 23:28:21

阅读数 1368

评论数 0

【每日一题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 t...

2018-08-24 12:31:01

阅读数 37

评论数 0

【每日一题Leetcode】160. Intersection of Two Linked Lists

Write a program to find the node at which the intersection of two singly linked lists begins.   For example, the following two linked lists: A: ...

2018-08-23 12:29:13

阅读数 23

评论数 0

【每日一题Leetcode】155. 最小 Stack

Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) -- Push element x onto stack. pop() -- Re...

2018-07-31 23:29:46

阅读数 44

评论数 0

【每日一题Leetcode】-2. Add Two Numbers

You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes conta...

2018-07-25 16:07:10

阅读数 43

评论数 0

【每日一题leetcode】-141 Linked List Cycle

Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it without using extra space? 由于最开始没有弄清楚链表中循环可以从任何位置开始,判断条件是是否tail...

2018-07-23 15:00:00

阅读数 30

评论数 0

【每日一题Leetcode】9. Palindrome Number

Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward. Example 1: Input: 121 Output:...

2018-07-19 22:37:06

阅读数 19

评论数 0

【每日一题Leetcode】7. Reverse Integer

不太喜欢这个题,主要考虑的点是溢出问题。 Given a 32-bit signed integer, reverse digits of an integer. Example 1: Input: 123 Output: 321 Example 2: Input: -123 Ou...

2018-07-18 12:25:58

阅读数 27

评论数 0

【每日一题Leetcode】-136. Single Number

Given a non-empty array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtim...

2018-07-12 16:34:15

阅读数 26

评论数 0

【每日一题Leedcode】121. 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 were only permitted to complete at most one transaction...

2018-07-04 16:33:47

阅读数 33

评论数 0

【每日一题Leetcode】104. Maximum Depth of Binary Tree

Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest l...

2018-07-02 13:35:32

阅读数 29

评论数 0

【每日一题Leetcode】101Symmetric Tree

Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree [1,2,2,3,4,4,3] is symmet...

2018-06-29 14:47:33

阅读数 34

评论数 0

【每日一题Leetcode】100. Same Tree

Given 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 ident...

2018-06-28 16:39:34

阅读数 33

评论数 0

【每日一题leetcode】70 Climbing Stairs

这道题花了蛮久时间,刚开始接触DP,需要多一些思维训练。 题目: **You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 step...

2018-06-27 17:18:56

阅读数 424

评论数 0

【每日一题leetcode】53. Maximum Subarray

Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.   Example:...

2018-06-25 17:54:54

阅读数 35

评论数 0

【每日一题leetcode】Merge Two Sorted Lists

Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.Example:...

2018-06-25 14:40:39

阅读数 24

评论数 0

【每日一题leetcode】Search Insert Position

继续把知乎发的挪到这里https://zhuanlan.zhihu.com/p/38404527题目:Given a sorted array and a target value, return the index if the target is found. If not, return t...

2018-06-25 14:40:01

阅读数 28

评论数 0

取消 删除