- 博客(17)
- 资源 (6)
- 收藏
- 关注
原创 39. Combination Sum
Given a set of candidate numbers (C) (without duplicates) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.The same repeated number may be chosen from C
2017-10-25 22:07:57 184
原创 38. Count and Say
The count-and-say sequence is the sequence of integers with the first five terms as following:1112112111112211 is read off as “one 1” or 11. 11 is read off as “two 1s” or 21. 21 is read off as
2017-10-24 21:04:39 185
原创 37. Sudoku Solver
Write a program to solve a Sudoku puzzle by filling the empty cells.Empty cells are indicated by the character ‘.’.You may assume that there will be only one unique solution. #include "SudokuSolver.h"b
2017-10-23 23:30:45 299
原创 36.Valid Sudoku
Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules.The Sudoku board could be partially filled, where empty cells are filled with the character ‘.’.判断一个数独板是否是有效的,数独板存在空白格,用’.’表示。#i
2017-10-22 21:11:44 402
转载 【C/C++】对char* 和 char[]区别的一些理解
相同点首先 这两种类型都可以对应一个字符串,比如: char * a=”string1”; char b[]=”string2”; printf(“a=%s, b=%s”, a, b); 其中a是一个指向char变量的指针,b则是一个char数组(字符数组),其次 ,很多时候二者可以混用,像函数传参数的时候,实参可以是char*,形参可以是 char[],比如: void fun1(cha
2017-10-20 00:30:58 67532 8
原创 35. Search Insert Position
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates in the array.Here
2017-10-19 21:53:21 187
原创 34. Search for a Range
Given an array of integers sorted in ascending order, find the starting and ending position of a given target value.Your algorithm’s runtime complexity must be in the order of O(log n).If the target is
2017-10-18 22:42:32 194
原创 33. Search in Rotated Sorted Array
Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).You are given a target value to search. If found in the ar
2017-10-18 21:15:45 201
原创 32. Longest Valid Parentheses
Given a string containing just the characters ‘(’ and ‘)’, find the length of the longest valid (well-formed) parentheses substring.For “(()”, the longest valid parentheses substring is “()”, which has
2017-10-15 23:25:44 297
原创 31. Next Permutation
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange it as the lowest possible orde
2017-10-13 00:08:05 419
原创 30. Substring with Concatenation of All Words
You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in s that is a concatenation of each word in words exactly once and wit
2017-10-12 01:18:15 331
原创 29. Divide Two Integers
Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT. 不使用乘法、除法和取余操作实现两数相除。 若数值溢出,返回MAX_INT.#include "limits.h"#include <algorithm>int DivideTw
2017-10-11 00:11:51 287
原创 28. Implement strStr()
Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. 实现strStr()函数。 返回needle在haystack中第一次出现的位置,若needle不在其中则返回-1.方法一:int Implement
2017-10-10 08:40:09 199
原创 27. Remove Element
Given an array and a value, remove all instances of that value in place and return the new length.Do not allocate extra space for another array, you must do this in place with constant memory.The order
2017-10-09 01:19:23 215
原创 26. Remove Duplicates from Sorted Array
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this in place with cons
2017-10-09 00:31:47 179
原创 25. Reverse Nodes in k-Group
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.k is a positive integer and is less than or equal to the length of the linked list. If the number of nod
2017-10-08 21:36:46 240
原创 24. 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 only constant space. You may no
2017-10-08 18:02:26 253
QRCode二维码编码解码工具(C++)
2016-12-07
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人