• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • YouClaw
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

nunca

但行好事 莫问前程
  • 博客园
  • 联系
  • 订阅
  • 管理

公告

03 2018 档案

LeetCode Easy: 70. Climbing Stairs
摘要:一、题目 You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can y 阅读全文

posted @ 2018-03-31 21:42 乐晓东随笔 阅读(147) 评论(0) 推荐(0)

LeetCode Easy: 69. Sqrt(x)
摘要:一、题目 Implement int sqrt(int x). Compute and return the square root of x. x is guaranteed to be a non-negative integer. 返回一个非负整数的平方根 二、题目解析 这个可以用二分查找来做 阅读全文

posted @ 2018-03-30 08:26 乐晓东随笔 阅读(151) 评论(0) 推荐(0)

LeetCode Easy: 67. Add Binary
摘要:一、题目 Given two binary strings, return their sum (also a binary string). For example,a = "11"b = "1"Return "100". 二进制加法 二、解题思路 第一种:先将二进制转换成十进制,做十进制加法,然 阅读全文

posted @ 2018-03-29 09:13 乐晓东随笔 阅读(167) 评论(0) 推荐(0)

LeetCode Easy: 66. Plus One
摘要:一、题目 Given a non-negative integer represented as a non-empty array of digits, plus one to the integer. You may assume the integer do not contain any l 阅读全文

posted @ 2018-03-28 08:43 乐晓东随笔 阅读(180) 评论(0) 推荐(0)

python中循环迭代问题
摘要:在python中循环的初始值永远从0开始,不管前面如何赋值,如下代码: 虽然起初我们给 i 赋值 1,但是开始下面循环的时候,i 初值依然为0。 阅读全文

posted @ 2018-03-28 08:10 乐晓东随笔 阅读(209) 评论(0) 推荐(0)

ValueError: c of shape (1, 300) not acceptable as a color sequence for x with size 300, y with size 300
摘要:报错如图所示 源码一般情况下,水平有限,不敢乱动,找到相应的报错路径,将代码 阅读全文

posted @ 2018-03-27 10:58 乐晓东随笔 阅读(3085) 评论(0) 推荐(0)

LeetCode Easy: 58. Length of Last Word
摘要:一、题目 Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string. If the last 阅读全文

posted @ 2018-03-27 06:52 乐晓东随笔 阅读(150) 评论(0) 推荐(0)

python中的split方法
摘要:参考:http://www.runoob.com/python/att-string-split.html Python split()通过指定分隔符对字符串进行切片,如果参数num 有指定值,则仅分隔 num 个子字符串 语法: 其中str -- 分隔符,默认所有的空字符串,包括空格、换行(\n) 阅读全文

posted @ 2018-03-27 06:47 乐晓东随笔 阅读(438) 评论(0) 推荐(0)

python中字典中的 get 方法
摘要:python中字典的使用非常普遍,字典也有很多方法,今天遇到了字典的get方法,用法如下: Python 字典(Dictionary) get() 函数返回指定键的值,如果值不在字典中返回默认值。 语法: key -- 字典中要查找的键。 default -- 如果指定键的值不存在时,返回该默认值值 阅读全文

posted @ 2018-03-26 17:36 乐晓东随笔 阅读(2683) 评论(0) 推荐(0)

LeetCode Easy: 53. Maximum Subarray
摘要:一、题目 Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [-2,1,-3,4, 阅读全文

posted @ 2018-03-26 15:32 乐晓东随笔 阅读(171) 评论(0) 推荐(0)

python中的列表表达式(列表推导式)
摘要:python中有一中十分好用的功能:列表表达式或者列表推导式 目前先用到这么多,以后遇到再加 阅读全文

posted @ 2018-03-26 11:58 乐晓东随笔 阅读(1447) 评论(0) 推荐(0)

LeetCode Easy: 35. Search Insert Position
摘要:一、题目 Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted 阅读全文

posted @ 2018-03-25 10:44 乐晓东随笔 阅读(148) 评论(0) 推荐(0)

LeetCode Easy: 38. Count and Say
摘要:一、题目 The count-and-say sequence is the sequence of integers with the first five terms as following: 1 is read off as "one 1" or 11.11 is read off as " 阅读全文

posted @ 2018-03-25 10:15 乐晓东随笔 阅读(154) 评论(0) 推荐(0)

LeetCode Easy: 28. Implement strStr()
摘要:一、题目 Implement strStr(). Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Example 1: Example 2 阅读全文

posted @ 2018-03-24 07:38 乐晓东随笔 阅读(134) 评论(0) 推荐(0)

C#中集合的交集:Intersect问题
摘要:集合的包含关系常见的有: 用法比较简单: L1.Intersect / Except / Union ( L2 ) 在实际应用过程中,遇到这样一个问题,代码附下: 如上代码所示,我的目的是想找到mList(类型为List<List<string>>,其中每个元素都是 List<string> 类型 阅读全文

posted @ 2018-03-23 15:38 乐晓东随笔 阅读(3438) 评论(0) 推荐(0)

LeetCode Easy: 27. Remove Element
摘要:一、题目 Given an array and a value, remove all instances of that value in-place and return the new length. Do not allocate extra space for another array, 阅读全文

posted @ 2018-03-23 09:08 乐晓东随笔 阅读(134) 评论(0) 推荐(0)

LeetCode Easy: 26.Remove Duplicates from Sorted Array
摘要:一、题目 Given a sorted array, remove the duplicates in-place such that each element appear only once and return the new length. Do not allocate extra spa 阅读全文

posted @ 2018-03-22 08:48 乐晓东随笔 阅读(102) 评论(0) 推荐(0)

LeetCode Easy: 21. 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.(合并两 阅读全文

posted @ 2018-03-21 11:54 乐晓东随笔 阅读(135) 评论(0) 推荐(0)

LeetCode Easy: 20. Valid Parentheses
摘要:一、题目 Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in 阅读全文

posted @ 2018-03-20 10:55 乐晓东随笔 阅读(133) 评论(0) 推荐(0)

LeetCode Easy: 14. Longest Common Prefix
摘要:参考博客:http://blog.csdn.net/nxhyd/article/details/71566780 一、题目 Write a function to find the longest common prefix string amongst an array of strings. 找 阅读全文

posted @ 2018-03-19 22:04 乐晓东随笔 阅读(115) 评论(0) 推荐(0)

LeetCode Easy: 13. Roman to Integer
摘要:一、题目 Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. 二、思路解析 罗马数规则如下: 将数字和字符串对应,当然需要用到字典,循环 阅读全文

posted @ 2018-03-18 11:16 乐晓东随笔 阅读(121) 评论(0) 推荐(0)

LeetCode Easy: Palindrome Number
摘要:一、题目 Determine whether an integer is a palindrome. Do this without extra space. 二、解题思路 首先我想到的是把给定的数变成字符串,通过字符串反转判断是否相等来判断原数是不是回文数。首先要判断给定的数是不是负数,负数肯定不 阅读全文

posted @ 2018-03-17 10:00 乐晓东随笔 阅读(101) 评论(0) 推荐(0)

DL: 初试 tensorflow
摘要:一、TensorFlow安装 win 7 下安装 TensorFlow并不困难,cmd下 pip install TensorFlow即可 二、对于TensorFlow初学者,MNIST数据集试验就像是初学编程的“Hello,world”,第一次尝试并不困难,网上教程挺多。 参考博客: http:/ 阅读全文

posted @ 2018-03-16 21:49 乐晓东随笔 阅读(189) 评论(0) 推荐(0)

LeetCode 第七题:Reverse Integer
摘要:一、题目 Given a 32-bit signed integer, reverse digits of an integer. Example 1: Example 2: Example 3: 二、解题思路 首先我想到的是字符串的反转问题,利用栈进行,先把给定的整数转换成字符串,然后把元素压入栈 阅读全文

posted @ 2018-03-16 09:01 乐晓东随笔 阅读(276) 评论(0) 推荐(0)

LeetCode 第三题:Longest Substring Without Repeating Characters
摘要:一、题目 Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the 阅读全文

posted @ 2018-03-15 16:03 乐晓东随笔 阅读(145) 评论(0) 推荐(0)

哈希表(散列表)
摘要:一、写在前面的 数组寻址容易,插入和删除困难;而链表寻址困难,但插入和删除容易;结合以上两点,衍生出哈希表结构。 比如在一个动态查找问题中,可以利用AVL树解决,但AVL树更擅长处理数字之间的比较,而变量名之间的比较是字符串之间的比较,字符串之间的比较需要一个一个地比较,比数字之间的比较复杂的多,如 阅读全文

posted @ 2018-03-15 12:10 乐晓东随笔 阅读(310) 评论(2) 推荐(0)

LeetCode 线性表篇:Add Two Number
摘要:一、题目描述 题目原文: You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes cont 阅读全文

posted @ 2018-03-14 10:19 乐晓东随笔 阅读(441) 评论(0) 推荐(0)

Ng deep learning 2_1
摘要:Python Basics with Numpy (optional assignment) Welcome to your first assignment. This exercise gives you a brief introduction to Python. Even if you'v 阅读全文

posted @ 2018-03-09 15:41 乐晓东随笔 阅读(310) 评论(0) 推荐(0)

 
博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3