自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

uj_mosquito的专栏

菜鸟一枚

原创 shell编程小tip(陆续更新)

1、运算 e.g. ((data=$data/10))和data=`expr $data /10`的区别 有的时候取出来的数data=08而不是8,,这时候用第一种就会出语法错误-bash: ((: data=08: value too great for base (error token is...

2015-03-10 12:24:49

阅读数 396

评论数 0

原创 Sum Root to Leaf Numbers

Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. An example is the root-to-leaf path 1->...

2015-02-04 17:44:12

阅读数 466

评论数 0

原创 4Sum

Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array w...

2015-02-04 17:14:13

阅读数 465

评论数 0

原创 3Sum Closest

Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers...

2015-02-04 16:11:00

阅读数 523

评论数 0

原创 3Sum

Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum ...

2015-02-04 12:59:21

阅读数 503

评论数 0

原创 Construct Binary Tree from Inorder and Postorder Traversal

Given inorder and postorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates do not exist in the tree. #in...

2015-01-30 17:57:45

阅读数 482

评论数 0

原创 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...

2015-01-30 15:32:53

阅读数 501

评论数 0

原创 Flatten Binary Tree to Linked List

Given a binary tree, flatten it to a linked list in-place. For example, Given 1 / \ 2 5 / \ \ 3 4 6 ...

2015-01-30 14:44:42

阅读数 355

评论数 0

原创 Next Permutation

Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not po...

2015-01-30 13:57:00

阅读数 361

评论数 0

原创 Balanced Binary Tree

Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as a binary tree in which the ...

2015-01-30 11:25:48

阅读数 527

评论数 0

原创 Integer to Roman

Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. string intToRoman(int num) { in...

2015-01-29 15:39:25

阅读数 457

评论数 0

原创 Longest Palindromic Substring

Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique...

2015-01-27 13:57:31

阅读数 410

评论数 0

原创 Gas Station

There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You have a car with an unlimited gas tank and it ...

2015-01-23 18:12:10

阅读数 408

评论数 0

原创 Construct Binary Tree from Preorder and Inorder Traversal

Given preorder and inorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates do not exist in the tree. #inc...

2015-01-23 15:49:44

阅读数 327

评论数 0

原创 Partition List

Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserve ...

2015-01-21 17:55:54

阅读数 481

评论数 0

原创 Permutations

Given a collection of numbers, return all possible permutations. For example, [1,2,3] have the following permutations: [1,2,3], [1,3,2], [2,1,3]...

2015-01-20 11:48:28

阅读数 367

评论数 0

原创 Pow(x, n)

Pow(x, n)  Total Accepted: 35792 Total Submissions: 135252My Submissions Question  Solution  Implement pow(x, n). #inclu...

2015-01-20 10:19:39

阅读数 425

评论数 0

原创 N-Queens II

Follow up for N-Queens problem. Now, instead outputting board configurations, return the total number of distinct solutions. class Solution...

2015-01-19 18:50:58

阅读数 388

评论数 0

原创 N-Queens

The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other. Given an integer n, ret...

2015-01-19 18:23:44

阅读数 311

评论数 0

原创 Multiply Strings

Given two numbers represented as strings, return multiplication of the numbers as a string. Note: The numbers can be arbitrarily large and are non...

2015-01-14 20:03:16

阅读数 329

评论数 0

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