chenyufeng's repositories
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 constant memory.
88.-Merge-Sorted-Array
Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note: You may assume that nums1 has enough space (size that is greater or equal to m + n) to hold additional elements from nums2. The number of elements initialized in nums1 and nums2 are m and n respectively.
BitAddAlgorithm
使用位运算符实现两个整数的加法。(递归与非递归两种方式实现)
1.-Two-Sum
Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution.
14.-Longest-Common-Prefix
Write a function to find the longest common prefix string amongst an array of strings.
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 of elements can be changed. It doesn't matter what you leave beyond the new length.
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.
3.-Longest-Substring-Without-Repeating-Characters
Given a string, find the length of the longest substring without repeating characters.
34.-Search-for-a-Range
Given a sorted array of integers, 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 not found in the array, return [-1, -1].
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.
48.-Rotate-Image
You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise).
49.-Group-Anagrams
Given an array of strings, group anagrams together.
5.-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 longest palindromic substring.
50.-Pow-x-n-
Implement pow(x, n).
58.-Length-of-Last-Word
Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string. If the last word does not exist, return 0.
66.-Plus-One
Given a non-negative number represented as an array of digits, plus one to the number. The digits are stored such that the most significant digit is at the head of the list.
67.-Add-Binary
Given two binary strings, return their sum (also a binary string). For example, a = "11" b = "1" Return "100".
7.-Reverse-Integer
Reverse digits of an integer.Example1: x = 123, return 321 Example2: x = -123, return -321
70.-Climbing-Stairs
You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?
8.-String-to-Integer-atoi-
Implement atoi to convert a string to an integer.
9.-Palindrome-Number
Determine whether an integer is a palindrome. Do this without extra space.
BinaryTreeHeight
求二叉树的高度。
InitEtherPudding
Ether-Pudding框架
InitNodejs
开发nodejs项目
STL_vector
C++ STL vector学习
ThreeNumberSum
三数和问题。
TraverseBinaryTreeNoRecursion
使用非递归方式遍历二叉树。
solidity-stringutils
Basic string utilities for Solidity