摘要:
原题链接在这里:https://leetcode.com/problems/find-the-difference/ 题目: Given two strings s and t which consist of only lowercase letters. String t is generate 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/add-strings/ 题目: Given two non-negative numbers num1 and num2 represented as string, return the sum of num1 and 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/add-two-numbers-ii/ 题目: You are given two linked lists representing two non-negative numbers. The most significa 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/find-all-anagrams-in-a-string/ 题目: Given a string s and a non-empty string p, find all the start indices of p's 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/island-perimeter/ 题目: You are given a map in form of a two-dimensional integer grid where 1 represents land and 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/design-hit-counter/description/ 题目: Design a hit counter which counts the number of hits received in the past 5 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/logger-rate-limiter/ 题目: Design a logger system that receive stream of messages along with its timestamps, each 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/moving-average-from-data-stream/ 题目: Given a stream of integers and a window size, calculate the moving average 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/fizz-buzz/ 题目: Write a program that outputs the string representation of numbers from 1 to n. But for multiples 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/sum-of-two-integers/ 题目: Calculate the sum of two integers a and b, but you are not allowed to use the operator 阅读全文
摘要:
Sorting: OrderBy ThenBy OrderByDescending ThenByDescending Reverse OrderBy a property that can have null value. null value will be sorted at the first 阅读全文
摘要:
In C#, extension methods enable you to add methods to existing class without creating a new derived class. Extension methods 要求: Extension methods cal 阅读全文
摘要:
In C#, out keyword 是argument传值变成passed by reference. out keyword 在同时返回多个值时很有用. 与ref keyword 相似. 若是使用out keyword传argument, 那么在method 的definition 和 使用时都 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/plus-one-linked-list/ 题目: Given a non-negative number represented as a singly linked list of digits, plus one to 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/reverse-vowels-of-a-string/ 题目: Write a function that takes a string as input and reverse only the vowels of a s 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/reverse-string/ 题目: Write a function that reverses a string. The input string is given as an array of characters 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/power-of-four/ 题目: Given an integer (signed 32 bits), write a function to check whether it is a power of 4. Exam 阅读全文
摘要:
原题链接在这里:http://www.lintcode.com/en/problem/longest-common-substring/# 题目: Given two strings, find the longest common substring. Return the length of i 阅读全文
摘要:
原题链接在这里:http://www.lintcode.com/en/problem/longest-common-subsequence/ 题目: Given two strings, find the longest common subsequence (LCS). Your code sho 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/coin-change/ 题目: You are given coins of different denominations and a total amount of money amount. Write a func 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/nested-list-weight-sum/ 题目: Given a nested list of integers, return the sum of all integers in the list weighted 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/find-the-celebrity/ 题目: Suppose you are at a party with n people (labeled from 0 to n - 1) and among them, there 阅读全文
摘要:
查找等差数列中的缺失项. e.g.Input: arr[] = {2, 4, 8, 10, 12, 14} Output: 6 Input: arr[] = {1, 6, 11, 16, 21, 31}; Output: 26. 采用binary search. 若是arr[mid] - arr[l 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/binary-tree-vertical-order-traversal/ 题目: Given a binary tree, return the vertical order traversal of its nodes' 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/verify-preorder-sequence-in-binary-search-tree/ 题目: Given an array of numbers, verify whether it is the correct 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/paint-house-ii/ 题目: There are a row of n houses, each house can be painted with one of the k colors. The cost of 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/paint-house/ 题目: There are a row of n houses, each house can be painted with one of the three colors: red, blue 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/house-robber-iii/ 题目: The thief has found himself a new place for his thievery again. There is only one entrance 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/ 题目: Given an array of integers that is already sorted in ascending order, find 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/two-sum-iii-data-structure-design/ 题目: Design and implement a TwoSum class. It should support the following oper 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/odd-even-linked-list/ 题目: Given a singly linked list, group all odd nodes together followed by the even nodes. P 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/burst-balloons/ 题目: Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represe 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/count-of-range-sum/ 题目: Given an integer array nums, return the number of range sums that lie in [lower, upper] 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/read-n-characters-given-read4-ii-call-multiple-times/ 题目: The API: int read4(char *buf) reads 4 characters at a 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/read-n-characters-given-read4/ 题目: The API: int read4(char *buf) reads 4 characters at a time from a file. The r 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/shortest-distance-from-all-buildings/ 题目: You want to build a house on an empty land which reaches all buildings 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/smallest-rectangle-enclosing-black-pixels/ 题目: An image is represented by a binary matrix with 0 as a white pixe 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/count-of-smaller-numbers-after-self/ 题目: You are given an integer array nums and you have to return a new counts 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/reconstruct-itinerary/description/ 题目: Given a list of airline tickets represented by pairs of departure and arr 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/minimum-height-trees/ 题目: For a undirected graph with tree characteristics, we can choose any node as the root. 阅读全文