随笔分类 -  算法

摘要:118. Pascal's Triangle Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5,Return 阅读全文
posted @ 2017-08-21 00:08 这个手杀不太0 阅读(268) 评论(0) 推荐(0)
摘要:204. Count Primes Count the number of prime numbers less than a non-negative number, n. 题意:计算小于非负数的质数数。 阅读全文
posted @ 2017-08-17 22:40 这个手杀不太0 阅读(260) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2017-08-17 22:03 这个手杀不太0 阅读(388) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2017-08-14 21:48 这个手杀不太0 阅读(185) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2017-08-14 20:11 这个手杀不太0 阅读(959) 评论(0) 推荐(0)
摘要:3. Longest Substring Without Repeating Characters Given a string, find the length of the longest substring without repeating characters. Examples: Giv 阅读全文
posted @ 2017-08-13 18:14 这个手杀不太0 阅读(275) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2017-08-13 15:28 这个手杀不太0 阅读(3133) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2017-08-12 21:00 这个手杀不太0 阅读(505) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2017-08-12 16:20 这个手杀不太0 阅读(252) 评论(7) 推荐(1)