自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 Triangle

Triangle Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. For example, given the following triangle [ [2], [3,

2018-01-21 00:40:21 187

原创 Path Sum II

Path Sum II Given a binary tree and a sum, find all root-to-leaf paths where each path’s sum equals the given sum. For example: Given the below binary tree and sum = 22, return [ [5,4,11,

2018-01-21 00:39:53 154

原创 Path sum

Path Sum Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. Given the below binary tree and sum = 22

2018-01-21 00:39:14 171

原创 Swap Nodes in Pairs

Swap Nodes in Pairs Given a linked list, swap every two adjacent nodes and return its head. For example, Given 1->2->3->4, you should return the list as 2->1->4->3. Your algorithm should use o

2018-01-21 00:36:38 166

原创 算法概论习题

8.3. STINGY SAT is the following problem: given a set of clauses (each a disjunction of literals) and an integer k, and a satisfying assignment in which at most k variables are true, if such an assignm

2018-01-21 00:35:54 364

原创 Pow(x, n)

50. Pow(x, n) Implement pow(x, n). example1 Input: 2.00000, 10 Output: 1024.00000 example2 Input: 2.10000, 3 Output: 9.26100 这道题要我实现pow(x,n)这个函数,也就是x的n次方的计算。 class Solution { pu

2018-01-20 21:10:42 192

原创 Group Anagrams

Group Anagrams Given an array of strings, group anagrams together. For example, given: [“eat”, “tea”, “tan”, “ate”, “nat”, “bat”], renturn: [ [“ate”, “eat”,”tea”], [“nat”,”tan”],

2018-01-20 20:59:37 146

原创 Median of Two Sorted Arrays

Median of Two Sorted Arrays There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n))

2018-01-20 19:31:09 119

原创 Multiply Strings

Multiply Strings Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2. note: The length of both num1 and num2 is Both num1 and num2 contains o

2018-01-20 19:06:15 172

原创 Integer to Roman

Integer to Roman Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. 之前写过将罗马数转化为整数,现在回顾一下罗马数的写法 I -> 1 V -> 5 X->10 L-> 50

2018-01-20 18:38:45 116

原创 Add Two Numbers

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 contain a single digit. Add the two num

2018-01-20 18:18:35 132

原创 Two Sum

Two Sum 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

2018-01-20 18:08:43 196

原创 Valid Parentheses

Valid Parentheses Given a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[’ and ‘]’, determine if the input string is valid. The brackets must close in the correct order, “()” and “()[

2018-01-20 17:56:02 140

原创 Longest Common Prefix

Longest Common Prefix Write a function to find the longest common prefix string amongst an array of strings. 以第一个String为标准,所有其他的String与第一个String比较,初始化一个String类型prefix来记录结果,当任意一个其他String的第k位与第一个Strin

2018-01-20 17:43:33 115

原创 Palindrome Number

Palindrome Number Determine whether an integer is a palindrome. Do this without extra space. 要看x是否是回数,应该初始化一个int类型z,让x的最高位数=z的最低位数,x的第二高位数=z的第二低位数,并以此类推。 代码块 代码块语法遵循标准markdown代码,例如: class S

2018-01-20 17:28:51 140

原创 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.思路要把两个已经排序的list(L1, L2)合并并且排好序。那么首先比较的就是两个队列的head,然后将val

2017-09-24 16:42:59 153

原创 Roman to Integer

题目描述Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999.思路做这道题之前我们首先要懂得罗马数字的写法。 I -> 1 V -> 5 X->10 L-> 50 C->100 D->500 M->10001.相同的数字连写、所表示的数

2017-09-24 15:35:25 154

原创 Count and say[easy on LeetCode]

Count and say[easy on LeetCode]原题地址:https://leetcode.com/problems/count-and-say/description/题目描述The count-and-say sequence is the sequence of integers with the first five terms as following: 1 1

2017-09-11 19:28:23 202

空空如也

空空如也

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

TA关注的人

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