![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
algorithm
浪漫硅谷
在代码路上我苦苦求索,只为心中的那个梦想
展开
-
LeetCode——018
/* 18. 4Sum My Submissions QuestionEditorial Solution Total Accepted: 69539 Total Submissions: 294220 Difficulty: Medium Given an array S of n integers, are there elements a, b, c, and d in S such原创 2016-04-16 09:57:47 · 389 阅读 · 0 评论 -
LeetCode——029
/* 29. Divide Two Integers My Submissions QuestionEditorial Solution Total Accepted: 64690 Total Submissions: 413492 Difficulty: Medium Divide two integers without using multiplication, division a原创 2016-04-16 16:04:36 · 411 阅读 · 0 评论 -
LeetCode——030
/* 30. Substring with Concatenation of All Words My Submissions QuestionEditorial Solution Total Accepted: 53094 Total Submissions: 255639 Difficulty: Hard You are given a string, s, and a list of原创 2016-04-16 17:15:49 · 387 阅读 · 0 评论 -
LeetCode——031
/* 31. Next Permutation My Submissions QuestionEditorial Solution Total Accepted: 63632 Total Submissions: 240911 Difficulty: Medium Implement next permutation, which rearranges numbers into the l原创 2016-04-16 17:40:37 · 262 阅读 · 0 评论 -
LeetCode——032
/* 32. Longest Valid Parentheses My Submissions QuestionEditorial Solution Total Accepted: 60805 Total Submissions: 271732 Difficulty: Hard Given a string containing just the characters ‘(’ and ‘)原创 2016-04-16 18:29:55 · 271 阅读 · 0 评论 -
LeetCode——033
/* 33. Search in Rotated Sorted Array My Submissions QuestionEditorial Solution Total Accepted: 98590 Total Submissions: 326117 Difficulty: Hard Suppose a sorted array is rotated at some pivot unk原创 2016-04-16 19:28:37 · 318 阅读 · 0 评论 -
LeetCode——034
/* 34. Search for a Range My Submissions QuestionEditorial Solution Total Accepted: 80156 Total Submissions: 275867 Difficulty: Medium Given a sorted array of integers, find the starting and endin原创 2016-04-16 20:28:14 · 358 阅读 · 0 评论 -
LeetCode——035
/* 35. Search Insert Position My Submissions QuestionEditorial Solution Total Accepted: 102229 Total Submissions: 274634 Difficulty: Medium Given a sorted array and a target value, return the inde原创 2016-04-16 21:02:01 · 241 阅读 · 0 评论 -
LeetCode——036
/*Valid Sudoku My Submissions QuestionEditorial Solution Total Accepted: 71051 Total Submissions: 233215 Difficulty: Easy Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules.原创 2016-04-17 08:42:30 · 237 阅读 · 0 评论 -
LeetCode——028
/* 28. Implement strStr() My Submissions QuestionEditorial Solution Total Accepted: 102448 Total Submissions: 413336 Difficulty: Easy Implement strStr().Returns the index of the first occurrence o原创 2016-04-16 15:47:19 · 526 阅读 · 0 评论 -
LeetCode——027
/* 27. Remove Element My Submissions QuestionEditorial Solution Total Accepted: 112934 Total Submissions: 335498 Difficulty: Easy Given an array and a value, remove all instances of that value in原创 2016-04-16 15:38:35 · 216 阅读 · 0 评论 -
LeetCode——019
/* 19. Remove Nth Node From End of List My Submissions QuestionEditorial Solution Total Accepted: 104327 Total Submissions: 355590 Difficulty: Easy Given a linked list, remove the nth node from th原创 2016-04-16 10:24:33 · 435 阅读 · 0 评论 -
LeetCode——020
/* 20. Valid Parentheses My Submissions QuestionEditorial Solution Total Accepted: 103991 Total Submissions: 355405 Difficulty: Easy Given a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}原创 2016-04-16 10:39:20 · 280 阅读 · 0 评论 -
LeetCode——021
/* 21. Merge Two Sorted Lists My Submissions QuestionEditorial Solution Total Accepted: 122136 Total Submissions: 345783 Difficulty: Easy Merge two sorted linked lists and return it as a new list.原创 2016-04-16 10:55:59 · 299 阅读 · 0 评论 -
LeetCode——022
/* 22. Generate Parentheses My Submissions QuestionEditorial Solution Total Accepted: 85070 Total Submissions: 231341 Difficulty: Medium Given n pairs of parentheses, write a function to generate原创 2016-04-16 11:26:40 · 353 阅读 · 0 评论 -
LeetCode——023
/* 23. Merge k Sorted Lists My Submissions QuestionEditorial Solution Total Accepted: 82416 Total Submissions: 354043 Difficulty: Hard Merge k sorted linked lists and return it as one sorted list.原创 2016-04-16 11:49:18 · 216 阅读 · 0 评论 -
LeetCode——024
/* 24. Swap Nodes in Pairs My Submissions QuestionEditorial Solution Total Accepted: 92808 Total Submissions: 264576 Difficulty: Easy Given a linked list, swap every two adjacent nodes and return原创 2016-04-16 12:07:57 · 312 阅读 · 0 评论 -
LeetCode——025
/* 25. Reverse Nodes in k-Group My Submissions QuestionEditorial Solution Total Accepted: 57696 Total Submissions: 210241 Difficulty: Hard Given a linked list, reverse the nodes of a linked list k原创 2016-04-16 15:18:22 · 363 阅读 · 0 评论 -
LeetCode——026
/* 26. Remove Duplicates from Sorted Array My Submissions QuestionEditorial Solution Total Accepted: 125285 Total Submissions: 375347 Difficulty: Easy Given a sorted array, remove the duplicates i原创 2016-04-16 15:29:02 · 327 阅读 · 0 评论 -
LeetCode——037
/* 37. Sudoku Solver My Submissions QuestionEditorial Solution Total Accepted: 48543 Total Submissions: 195911 Difficulty: Hard Write a program to solve a Sudoku puzzle by filling the empty cells.原创 2016-04-17 09:15:14 · 481 阅读 · 0 评论 -
LeetCode——038
/* 38. Count and Say My Submissions QuestionEditorial Solution Total Accepted: 78365 Total Submissions: 271881 Difficulty: Easy The count-and-say sequence is the sequence of integers beginning as原创 2016-04-17 09:46:27 · 389 阅读 · 0 评论 -
LeetCode——040
/* 40. Combination Sum II My Submissions QuestionEditorial Solution Total Accepted: 66386 Total Submissions: 241547 Difficulty: Medium Given a collection of candidate numbers (C) and a target numb原创 2016-04-17 10:32:45 · 322 阅读 · 0 评论 -
LeetCode——049
/* 49. Group Anagrams My Submissions QuestionEditorial Solution Total Accepted: 73397 Total Submissions: 267525 Difficulty: Medium Given an array of strings, group anagrams together.For example, g原创 2016-04-24 10:53:01 · 364 阅读 · 0 评论 -
LeetCode——050
/* 50. Pow(x, n) My Submissions QuestionEditorial Solution Total Accepted: 88936 Total Submissions: 319149 Difficulty: Medium Implement pow(x, n).Subscribe to see which companies asked this questi原创 2016-04-24 11:12:26 · 346 阅读 · 0 评论 -
LeetCode——051
/* 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, return all distinct solutions to the n-queens puzzle.Ea原创 2016-04-24 12:15:33 · 377 阅读 · 0 评论 -
LeetCode——052
/* Follow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions. Subscribe to see which companies asked this question */ /* 解题思路: 跟上一原创 2016-04-24 12:42:53 · 390 阅读 · 0 评论 -
LeetCode——053
/* 53. Maximum Subarray My Submissions QuestionEditorial Solution Total Accepted: 108862 Total Submissions: 297759 Difficulty: Medium Find the contiguous subarray within an array (containing at le原创 2016-04-24 13:15:30 · 347 阅读 · 0 评论 -
LeetCode——054
/* 54. Spiral Matrix My Submissions QuestionEditorial Solution Total Accepted: 57679 Total Submissions: 256710 Difficulty: Medium Given a matrix of m x n elements (m rows, n columns), return all e原创 2016-04-24 13:50:38 · 362 阅读 · 0 评论 -
LeetCode——055
/* 55. Jump Game My Submissions QuestionEditorial Solution Total Accepted: 76258 Total Submissions: 270540 Difficulty: Medium Given an array of non-negative integers, you are initially positioned原创 2016-04-24 15:43:56 · 424 阅读 · 0 评论 -
hihoCoder_A+B
A+B Problem描述求两个整数A+B的和。输入输入包含多组数据。每组数据包含两个整数A(1 ≤ A ≤ 100)和B(1 ≤ B ≤ 100)。输出对于每组数据输出A+B的和。样例输入1 2 3 4 5 6 样例输出3 7 11#include <iostream>using namespace std;int main(){ int a,b; while(cin>>原创 2016-07-20 20:02:10 · 428 阅读 · 0 评论 -
Leetcode——047
/* 47. Permutations II My Submissions QuestionEditorial Solution Total Accepted: 69185 Total Submissions: 247339 Difficulty: Medium Given a collection of numbers that might contain duplicates, ret原创 2016-04-24 10:03:21 · 475 阅读 · 0 评论 -
LeetCode——048
/* 48. Rotate Image My Submissions QuestionEditorial Solution Total Accepted: 66533 Total Submissions: 192145 Difficulty: Medium You are given an n x n 2D matrix representing an image.Rotate the i原创 2016-04-24 10:22:22 · 305 阅读 · 0 评论 -
LeetCode——039
/* 39. Combination Sum My Submissions QuestionEditorial Solution Total Accepted: 88140 Total Submissions: 286018 Difficulty: Medium Given a set of candidate numbers (C) and a target number (T), fi原创 2016-04-17 10:18:33 · 353 阅读 · 0 评论 -
LeetCode——041
/* 41. First Missing Positive My Submissions QuestionEditorial Solution Total Accepted: 62613 Total Submissions: 263261 Difficulty: Hard Given an unsorted integer array, find the first missing pos原创 2016-04-17 10:59:58 · 431 阅读 · 0 评论 -
LeetCode——042
/* 42. Trapping Rain Water My Submissions QuestionEditorial Solution Total Accepted: 64262 Total Submissions: 200013 Difficulty: Hard Given n non-negative integers representing an elevation map wh原创 2016-04-17 11:24:39 · 281 阅读 · 0 评论 -
C++实现——两个大数相乘
#include <iostream>#include <vector>#include <string>using namespace std;//大数相乘/***num1 乘数1*num2 乘数2*return 结果字符串*/string BigMutiple(string num1, string num2){ string res=""; //两个数的位数原创 2016-04-07 15:57:23 · 12781 阅读 · 1 评论 -
LeetCode——043
/* 43. Multiply Strings My Submissions QuestionEditorial Solution Total Accepted: 59659 Total Submissions: 255286 Difficulty: Medium Given two numbers represented as strings, return multiplication原创 2016-04-17 11:42:13 · 452 阅读 · 0 评论 -
LeetCode——044
/* 44. Wildcard Matching My Submissions QuestionEditorial Solution Total Accepted: 55229 Total Submissions: 317656 Difficulty: Hard Implement wildcard pattern matching with support for ‘?’ and ‘*’原创 2016-04-17 15:35:07 · 309 阅读 · 0 评论 -
LeetCode——045
/* 45. Jump Game II My Submissions QuestionEditorial Solution Total Accepted: 62218 Total Submissions: 246687 Difficulty: Hard Given an array of non-negative integers, you are initially positioned原创 2016-04-17 16:15:26 · 500 阅读 · 0 评论 -
LeetCode——056
/* 56. Merge Intervals My Submissions QuestionEditorial Solution Total Accepted: 65444 Total Submissions: 258498 Difficulty: Hard Given a collection of intervals, merge all overlapping intervals.F原创 2016-04-24 16:23:52 · 770 阅读 · 0 评论