上一页 1 2 3 4 5 6 ··· 8 下一页
Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -. Example:Given a = 1 and b = 2, return 3. 一般步骤: 1、计算不用进 Read More
posted @ 2016-08-20 13:05 sunalive Views(93) Comments(0) Diggs(0)
You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 ston Read More
posted @ 2016-08-20 11:32 sunalive Views(176) Comments(0) Diggs(0)
Write a function that takes a string as input and returns the string reversed. Example:Given s = "hello", return "olleh". Subscribe to see which compa Read More
posted @ 2016-08-10 21:52 sunalive Views(150) Comments(0) Diggs(0)
1、 >>> print('C:\some\name') # here \n means newline! C:\some ame >>> print(r'C:\some\name') # note the r before the quote C:\some\name第一个语句中 print中没有 Read More
posted @ 2016-01-31 23:08 sunalive Views(113) Comments(0) Diggs(0)
Given an array of integers, every element appearstwiceexcept for one. Find that single one.Note:Your algorithm should have a linear runtime complexity... Read More
posted @ 2015-10-01 22:05 sunalive Views(156) Comments(0) Diggs(0)
Given a binary tree, return thebottom-up level ordertraversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For exa... Read More
posted @ 2015-09-24 14:57 sunalive Views(189) Comments(0) Diggs(0)
Binary Tree Level Order TraversalMy SubmissionsQuestionSolutionTotal Accepted:67360Total Submissions:228717Difficulty:EasyGiven a binary tree, return ... Read More
posted @ 2015-09-24 14:45 sunalive Views(158) Comments(0) Diggs(0)
Given a set of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Thesamerepeated num... Read More
posted @ 2015-09-23 17:00 sunalive Views(175) Comments(0) Diggs(0)
class Solution {public: vector> fourSum(vector& nums, int target) { sort(nums.begin(),nums.end()); int n = nums.size(); vector... Read More
posted @ 2015-09-08 11:07 sunalive Views(134) Comments(0) Diggs(0)
Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty space i... Read More
posted @ 2015-09-06 16:27 sunalive Views(127) Comments(0) Diggs(0)
上一页 1 2 3 4 5 6 ··· 8 下一页