杨秀璋的专栏

无知 · 乐观 · 谦逊 · 低调 · 生活

[LeetCode] Palindrome Number & Valid Palindrome - 回文系列问题

题目概述: Determine whether an integer is a palindrome. Do this without extra space. 判断数字是否是回文 例如121、656、3443 方法有很多,正着看和到着看两数相同;当然负数显然不是回文 判读一个字符串是否是回文,一...

2015-09-24 02:48:07

阅读数:1290

评论数:0

[LeetCode] Count Primes - 素数系列问题

题目概述: Description: Count the number of prime numbers less than a non-negative number, n. 题意是给出n中所有素数的个数。参考Sieve of Eratosthenes(埃拉托色尼筛法,简称埃氏筛法),它的思想是...

2015-09-21 02:53:05

阅读数:1983

评论数:0

[LeetCode] Isomorphic Strings - 字符串操作:数组计数字符个数问题

题目概述: Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if the characters in s can be replaced to get t. 该题意是判断...

2015-09-21 01:14:30

阅读数:1280

评论数:0

[LeetCode] Move Zeroes - 整数数组处理问题

Move Zeroes - 数组0移到末尾 [顺序交换] 题目概述: Given an arraynums, write a function to move all 0's to the end of it while maintaining the relative order of the...

2015-09-20 20:11:11

阅读数:3279

评论数:0

[LeetCode] Reverse Linked List I II - 链表翻转问题

[LeetCode] Reverse Linked List I II - 链表翻转问题 题目概述: Reverse a singly linked list. 翻转一个单链表,如:1->2 输出 2->1;1->2->3 输出3->2->1。 题目解析:第二种...

2015-09-14 19:09:56

阅读数:1350

评论数:0

[LeetCode] Valid Anagram - 字符串排序比较系列

题目概述:字符串处理类型 主要讲述sort排序方法和计算字母个数的方法 Given two strings s and t, write a function to determine if t is an anagram of s. For example, s = "anagram&...

2015-09-14 07:01:49

阅读数:1419

评论数:0

[LeetCode] Number of 1 Bits & Reverse Integer - 整数问题系列

目录: 1.Number of 1 Bits - 计算二进制1的个数 [与运算] 2.Contains Duplicate - 是否存在重复数字 [遍历] 3.Reverse Integer - 翻转整数 [int边界问题] Write a function that takes an unsi...

2015-09-14 05:15:15

阅读数:1629

评论数:0

[LeetCode] Invert Binary Tree - 二叉树翻转系列问题

目录: Binary Tree Level Order Traversal - 二叉树层次遍历 BFS 题目背景是MaxHowell(他是苹果电脑最受欢迎的homebrew程序作者)去Google面试,面试官说:“虽然在Google有90%的工程师用你写的Homebrew,但是你居然不能再白板上写...

2015-09-12 05:33:35

阅读数:1752

评论数:0

[LeetCode] Binary Tree Level Order Traversal 二叉树层次遍历(DFS | BFS)

题目:Binary Tree Level Order Traversal - 二叉树层次遍历 (DFS | BFS) Given a binary tree, return the level order traversal of its nodes' values. (ie, from left...

2015-09-11 02:20:37

阅读数:3586

评论数:0

[LeetCode] Remove Duplicates from Sorted List - 链表问题

题目概述: Given a sorted linked list, delete all duplicates such that each element appear only once. For example, Given 1->1->2, return 1->2. Gi...

2015-09-10 03:33:30

阅读数:1039

评论数:0

[LeetCode] Plus One - 整数字符转换相加

题目概述:Plus One - 整数加一 Given a non-negative number represented as an array of digits, plus one to the number. The digits are stored such that the most ...

2015-09-09 05:19:20

阅读数:2447

评论数:0

[LeetCode] First Bad Version - 二分查找

题目概述:First Bad Version - 二分查找 最后一个坏的版本 You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest ver...

2015-09-09 02:16:49

阅读数:1122

评论数:0

[LeetCode] Binary Tree Paths - 二叉树基础系列题目

题目概述:Binary Tree Paths - 二叉树路径 Given a binary tree, return all root-to-leaf paths. For example, given the following binary tree: 希望文章对你有所帮助~

2015-09-09 00:58:21

阅读数:1993

评论数:0

[LeetCode] Add Digits - 数字各个位数求和

题目概述:Add Digits 数字各个位数求和 Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. For example: Given num ...

2015-09-08 18:06:18

阅读数:2140

评论数:0

[LeetCode] Length of Last Word - 最后一个单词的长度

题目概述: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 th...

2015-09-08 05:08:56

阅读数:1655

评论数:0

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