自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(8)
  • 收藏
  • 关注

原创 LeetCode 483 Smallest Good Base 解题报告

用三种不同的方法解Problem Description483 Smallest Good Base. 原文链接: http://hankerzheng.com/blog/LeetCode-Smallest-Good-Base

2017-02-05 09:18:45 2565

原创 LeetCode 421 Maximum XOR of Two Numbers in an Array 解题报告

一道有意思的题目, 用到了异或运算的一个小特性. LeetCode 421 Maximum XOR of Two Numbers in an Array. Given a non-empty array of numbers, a0, a1, a2, … , an-1, where 0 ≤ ai < 231. Find the maximum result of ai XOR aj

2017-02-02 11:27:24 2651 1

原创 LeetCode 4 Median of Two Sorted Arrays 解题报告

原文链接: http://hankerzheng.com/blog/LeetCode-Median-of-Two-Sorted-ArraysProblem DescriptionLeetCode 4 Median of Two Sorted Arrays There are two sorted arrays nums1 and nums2 of size m and n respectively

2017-01-29 10:39:38 354

翻译 Python Metaclass超类入门介绍

原文链接: http://hankerzheng.com/blog/python-metaclass-introduction前言在编程过程中碰到了关于metaclass的问题, 于是google相关解释, 就找到了下面这篇文章 A Primer on Python Metaclasses. 在第二次读此文时萌生了翻译的念头, 客官们就凑合看看吧~ 以下为翻译

2017-01-26 11:15:46 654

原创 Python实现Hash Heap数据结构

原文链接: http://hankerzheng.com/blog/Python-Hash-HeapLeetCode 480 Sliding Window Median 这题真是丧心病狂! 找中位数当然用Heap或者Balanced BST了, 然后Sliding Window当然需要支持Delete操作了. 好吧, 在Python中并没有自带的能同时支持两者的数据结构.

2017-01-26 11:12:15 839

原创 LeetCode 488 Zuma Game 解题报告

原文链接: http://hankerzheng.com/blog/Leetcode-Zuma-Game-Problem DescriptionLeetCode 488 Zuma Game You have a row of balls on the table, colored red(R), yellow(Y), blue(B), green(G), and white(W).

2017-01-26 11:10:14 2852 2

原创 Python中变量交换的陷阱

Pythonic交换变量出错啦在做Leetcode 143 Reorder List 这这题目时候, 发现了一个关于Python变量交换很神奇的问题.这题目很简单, 先将链表分成前后两段, 然后再对后段进行反转, 最后重新合并两个列表. 这个奇怪的问题就出在对链表进行反转的过程中.Pass的代码如下:class Solution(object): def reorderList(self,

2016-09-04 09:27:20 848

原创 Google/foobar - Spy snippets

Given n arrays, choose one integer from each array to create a new array. How to make the max-min in the new array the minimum.

2016-01-27 17:04:35 1055

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除