随笔分类 -  LeetCode

上一页 1 2 3 4 5 6 7 8 ··· 14 下一页
摘要:Given a string, your task is to count how many palindromic substrings in this string. The substrings with different start indexes or end indexes are c 阅读全文
posted @ 2018-01-20 15:00 immjc 阅读(149) 评论(0) 推荐(0)
摘要:Given a sorted array consisting of only integers where every element appears twice except for one element which appears once. Find this single element 阅读全文
posted @ 2018-01-19 21:54 immjc 阅读(123) 评论(0) 推荐(0)
摘要:Given a binary tree, find the leftmost value in the last row of the tree. Example 1: Example 2: Note: You may assume the tree (i.e., the given root no 阅读全文
posted @ 2018-01-19 14:44 immjc 阅读(139) 评论(0) 推荐(0)
摘要:Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements that appear twi 阅读全文
posted @ 2018-01-19 14:09 immjc 阅读(116) 评论(0) 推荐(0)
摘要:Suppose you have a random list of people standing in a queue. Each person is described by a pair of integers (h, k), where h is the height of the pers 阅读全文
posted @ 2018-01-18 18:13 immjc 阅读(132) 评论(0) 推荐(0)
摘要:Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation and r 阅读全文
posted @ 2018-01-18 14:09 immjc 阅读(114) 评论(0) 推荐(0)
摘要:Given an 2D board, count how many battleships are in it. The battleships are represented with 'X's, empty slots are represented with '.'s. You may ass 阅读全文
posted @ 2018-01-17 10:24 immjc 阅读(141) 评论(0) 推荐(0)
摘要:Given two strings representing two complex numbers. You need to return a string representing their multiplication. Note i2 = -1 according to the defin 阅读全文
posted @ 2018-01-16 20:15 immjc 阅读(168) 评论(0) 推荐(0)
摘要:A string S of lowercase letters is given. We want to partition this string into as many parts as possible so that each letter appears in at most one p 阅读全文
posted @ 2018-01-15 21:45 immjc 阅读(330) 评论(0) 推荐(0)
摘要:Given two integers L and R, find the count of numbers in the range [L, R] (inclusive) having a prime number of set bits in their binary representation 阅读全文
posted @ 2018-01-15 16:56 immjc 阅读(173) 评论(0) 推荐(0)
摘要:Given an integer array with no duplicates. A maximum tree building on this array is defined as follow: Construct the maximum tree by the given array a 阅读全文
posted @ 2018-01-15 11:27 immjc 阅读(140) 评论(0) 推荐(0)
摘要:Given two lists Aand B, and B is an anagram of A. B is an anagram of A means B is made by randomizing the order of the elements in A. We want to find 阅读全文
posted @ 2018-01-09 15:47 immjc 阅读(157) 评论(0) 推荐(0)
摘要:Find the largest palindrome made from the product of two n-digit numbers. Since the result could be very large, you should return the largest palindro 阅读全文
posted @ 2018-01-06 14:01 immjc 阅读(204) 评论(0) 推荐(0)
摘要:Given a text file file.txt that contains list of phone numbers (one per line), write a one liner bash script to print all valid phone numbers. You may 阅读全文
posted @ 2018-01-05 22:55 immjc 阅读(171) 评论(0) 推荐(0)
摘要:You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality c 阅读全文
posted @ 2018-01-05 16:27 immjc 阅读(91) 评论(0) 推荐(0)
摘要:Description: Count the number of prime numbers less than a non-negative number, n. 使用sieve of Eratosthenes方法对质数进行筛选。 题目要求就是写出这个算法。 原理是:给出要筛数值的范围n,找出出以 阅读全文
posted @ 2018-01-05 14:58 immjc 阅读(187) 评论(0) 推荐(0)
摘要:Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example,"A man, a plan, a canal: Pan 阅读全文
posted @ 2018-01-04 23:08 immjc 阅读(109) 评论(0) 推荐(0)
摘要:Given a non-empty array of integers, return the third maximum number in this array. If it does not exist, return the maximum number. The time complexi 阅读全文
posted @ 2018-01-04 20:13 immjc 阅读(179) 评论(0) 推荐(0)
摘要:Given an array of integers and an integer k, you need to find the number of unique k-diff pairs in the array. Here a k-diff pair is defined as an inte 阅读全文
posted @ 2018-01-04 12:47 immjc 阅读(203) 评论(0) 推荐(0)
摘要:You are given a license key represented as a string S which consists only alphanumeric character and dashes. The string is separated into N+1 groups b 阅读全文
posted @ 2018-01-03 22:10 immjc 阅读(222) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 7 8 ··· 14 下一页