随笔分类 - 算法
摘要:118. Pascal's Triangle Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5,Return
阅读全文
摘要:204. Count Primes Count the number of prime numbers less than a non-negative number, n. 题意:计算小于非负数的质数数。
阅读全文
摘要:202. Happy Number Write an algorithm to determine if a number is "happy". A happy number is a number defined by the following process: Starting with a
阅读全文
摘要: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 ne
阅读全文
摘要:11. Container With Most Water Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are
阅读全文
摘要:3. Longest Substring Without Repeating Characters Given a string, find the length of the longest substring without repeating characters. Examples: Giv
阅读全文
摘要: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
阅读全文
摘要: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 cl
阅读全文
摘要:Given an array of integers, every element appears twice except for one. Find that single one. Note:Your algorithm should have a linear runtime complex
阅读全文

浙公网安备 33010602011771号