伪程序员的世界

Debug myself and debug the world!


  • 首页

  • 归档

  • 分类

  • 标签

  • 搜索

LeetCode 2.Add Two Numbers,67.Add Binary,371.Sum of Two Integers,66.Plus One

发表于 2017-12-10 | 分类于 算法 , LeetCode
字数统计: 5k | 阅读时长≈ 0:05

LeetCode 2.Add Two Numbers

Description:

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 contain a single digit. Add the two numbers and return it as a linked list.

You may assume the two numbers do not contain any leading zero, except the number 0 itself.

Input: (2 -> 4 -> 3) + (5 -> 6 -> 4)
Output: 7 -> 0 -> 8

Difficulty:Medium

阅读全文 »

由LeetCode 1.Two Sum引起的几个问题

发表于 2017-12-10 | 分类于 算法 , LeetCode
字数统计: 5k | 阅读时长≈ 0:05

LeetCode 1.Two Sum

Description:

Given an array of integers, return indices of the two numbers such that they add up to a specific target.

You may assume that each input would have exactly one solution, and you may not use the same element twice.

阅读全文 »

LeetCode 53. Maximum Subarray and 121. Best Time to Buy and Sell Stock最大子数组问题

发表于 2017-12-10 | 分类于 算法 , LeetCode
字数统计: 7k | 阅读时长≈ 0:07

LeetCode 53. Maximum Subarray

Description:

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,-1,2,1,-5,4],
the contiguous subarray [4,-1,2,1] has the largest sum = 6.

Difficulty:Easy

阅读全文 »

LeetCode 169. Majority Element and LeetCode 229. Majority Element II解题报告

发表于 2017-12-10 | 分类于 算法 , LeetCode
字数统计: 3.4k | 阅读时长≈ 0:03

LeetCode 169.Majority Element

Description:

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-empty and the majority element always exist in the array.
Credits:
Special thanks to @ts for adding this problem and creating all test cases.

Difficulty:Easy

阅读全文 »

LeetCode 414.Third Maximum Number

发表于 2017-12-10 | 分类于 算法 , LeetCode
字数统计: 2.6k | 阅读时长≈ 0:03

LeetCode 414.Third Maximum Number

Description:

Given a non-empty array of integers, return the third maximum number in this array. If it does not exist, return the maximum number. The time complexity must be in O(n).

阅读全文 »

BeginFromZero

发表于 2017-12-09
字数统计: 20 | 阅读时长≈ 0:01

Welcome to my blog!

1…1011
linjiafengyang

linjiafengyang

Debug myself and debug the world!

106 日志
7 分类
3 标签
GitHub CSDN
© 2019 linjiafengyang | 394k | 6:34