随笔分类 -  algorithm

上一页 1 2 3 4 5 6 ··· 13 下一页
摘要: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-30 12:52 逸朵 阅读(131) 评论(0) 推荐(0)
摘要: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 tha 阅读全文
posted @ 2018-01-29 13:51 逸朵 阅读(111) 评论(0) 推荐(0)
摘要:Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si < ei), determine if a person could attend all mee 阅读全文
posted @ 2018-01-29 13:17 逸朵 阅读(116) 评论(0) 推荐(0)
摘要:Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacen 阅读全文
posted @ 2018-01-29 13:06 逸朵 阅读(104) 评论(0) 推荐(0)
摘要: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 ex 阅读全文
posted @ 2018-01-29 12:54 逸朵 阅读(95) 评论(0) 推荐(0)
摘要:Given a list accounts, each element accounts[i] is a list of strings, where the first element accounts[i][0] is a name, and the rest of the elements a 阅读全文
posted @ 2018-01-29 08:25 逸朵 阅读(695) 评论(0) 推荐(0)
摘要:You are given a m x n 2D grid initialized with these three possible values. Fill each empty room with the distance to its nearest gate. If it is impos 阅读全文
posted @ 2018-01-29 06:27 逸朵 阅读(145) 评论(0) 推荐(0)
摘要:You are given a list of non-negative integers, a1, a2, ..., an, and a target, S. Now you have 2 symbols + and -. For each integer, you should choose o 阅读全文
posted @ 2018-01-29 06:10 逸朵 阅读(112) 评论(0) 推荐(0)
摘要:Given a list of non-negative numbers and a target integer k, write a function to check if the array has a continuous subarray of size at least 2 that 阅读全文
posted @ 2018-01-28 11:13 逸朵 阅读(126) 评论(0) 推荐(0)
摘要:Given a non-negative integer, you could swap two digits at most once to get the maximum valued number. Return the maximum valued number you could get. 阅读全文
posted @ 2018-01-28 07:06 逸朵 阅读(106) 评论(0) 推荐(0)
摘要:Given a binary search tree and a node in it, find the in-order successor of that node in the BST. Note: If the given node has no in-order successor in 阅读全文
posted @ 2018-01-28 06:44 逸朵 阅读(106) 评论(0) 推荐(0)
摘要:Given the running logs of n functions that are executed in a nonpreemptive single threaded CPU, find the exclusive time of these functions. Each funct 阅读全文
posted @ 2018-01-28 06:17 逸朵 阅读(266) 评论(0) 推荐(0)
摘要:Given a non-empty string s, you may delete at most one character. Judge whether you can make it a palindrome. Example 1: Example 2: Note: 阅读全文
posted @ 2018-01-28 04:21 逸朵 阅读(103) 评论(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-28 03:58 逸朵 阅读(97) 评论(0) 推荐(0)
摘要:Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of the longestpath betwee 阅读全文
posted @ 2018-01-28 03:45 逸朵 阅读(91) 评论(0) 推荐(0)
摘要:Suppose you are at a party with n people (labeled from 0 to n - 1) and among them, there may exist one celebrity. The definition of a celebrity is tha 阅读全文
posted @ 2018-01-28 03:36 逸朵 阅读(114) 评论(0) 推荐(0)
摘要:The API: int read4(char *buf) reads 4 characters at a time from a file. The return value is the actual number of characters read. For example, it retu 阅读全文
posted @ 2018-01-28 03:26 逸朵 阅读(126) 评论(0) 推荐(0)
摘要:Given two sparse matrices A and B, return the result of AB. You may assume that A's column number is equal to B's row number. Example: 阅读全文
posted @ 2018-01-28 03:06 逸朵 阅读(96) 评论(0) 推荐(0)
摘要:Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si < ei), find the minimum number of conference room 阅读全文
posted @ 2018-01-28 02:05 逸朵 阅读(123) 评论(0) 推荐(0)
摘要:Given two binary strings, return their sum (also a binary string). For example,a = "11"b = "1"Return "100". 阅读全文
posted @ 2018-01-26 09:01 逸朵 阅读(94) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 ··· 13 下一页