随笔分类 -  algorithm

上一页 1 2 3 4 5 6 7 ··· 13 下一页
摘要:Remove the minimum number of invalid parentheses in order to make the input string valid. Return all possible results. Note: The input string may cont 阅读全文
posted @ 2018-01-26 08:18 逸朵 阅读(149) 评论(0) 推荐(0)
摘要:Given a char array representing tasks CPU need to do. It contains capital letters A to Z where different letters represent different tasks.Tasks could 阅读全文
posted @ 2018-01-26 03:54 逸朵 阅读(116) 评论(0) 推荐(0)
摘要:Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are n 阅读全文
posted @ 2018-01-22 10:01 逸朵 阅读(111) 评论(0) 推荐(0)
摘要:Given an unsorted integer array, find the first missing positive integer. For example,Given [1,2,0] return 3,and [3,4,-1,1] return 2. Your algorithm s 阅读全文
posted @ 2018-01-22 09:50 逸朵 阅读(119) 评论(0) 推荐(0)
摘要:Given n nodes labeled from 0 to n - 1 and a list of undirected edges (each edge is a pair of nodes), write a function to check whether these edges mak 阅读全文
posted @ 2018-01-20 03:38 逸朵 阅读(155) 评论(0) 推荐(0)
摘要:Given a sorted array, two integers k and x, find the k closest elements to x in the array. The result should also be sorted in ascending order. If the 阅读全文
posted @ 2018-01-20 02:24 逸朵 阅读(139) 评论(0) 推荐(0)
摘要:Given a list of directory info including directory path, and all the files with contents in this directory, you need to find out all the groups of dup 阅读全文
posted @ 2018-01-17 12:00 逸朵 阅读(665) 评论(0) 推荐(0)
摘要:Given an encoded string, return it's decoded string. The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is b 阅读全文
posted @ 2018-01-16 11:55 逸朵 阅读(145) 评论(0) 推荐(0)
摘要:Implement regular expression matching with support for '.' and '*'. 阅读全文
posted @ 2018-01-08 12:48 逸朵 阅读(137) 评论(0) 推荐(0)
摘要:Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1. Examples: Note: You may assume the 阅读全文
posted @ 2018-01-08 10:07 逸朵 阅读(214) 评论(0) 推荐(0)
摘要:Shuffle a set of numbers without duplicates. Example: 阅读全文
posted @ 2018-01-02 04:13 逸朵 阅读(130) 评论(0) 推荐(0)
摘要:Given a binary tree, collect a tree's nodes as if you were doing this: Collect and remove all leaves, repeat until the tree is empty. Example:Given bi 阅读全文
posted @ 2018-01-01 07:18 逸朵 阅读(219) 评论(0) 推荐(0)
摘要:Given a nested list of integers, return the sum of all integers in the list weighted by their depth. Each element is either an integer, or a list -- w 阅读全文
posted @ 2018-01-01 06:52 逸朵 阅读(387) 评论(0) 推荐(0)
摘要:Design a hit counter which counts the number of hits received in the past 5 minutes. Each function accepts a timestamp parameter (in seconds granulari 阅读全文
posted @ 2018-01-01 06:27 逸朵 阅读(296) 评论(0) 推荐(0)
摘要:Given a sorted array of integers nums and integer values a, b and c. Apply a quadratic function of the form f(x) = ax2 + bx + c to each element x in t 阅读全文
posted @ 2018-01-01 02:56 逸朵 阅读(248) 评论(0) 推荐(0)
摘要:Design a logger system that receive stream of messages along with its timestamps, each message should be printed if and only if it is not printed in t 阅读全文
posted @ 2018-01-01 02:32 逸朵 阅读(231) 评论(0) 推荐(0)
摘要:Write a function that takes a string as input and reverse only the vowels of a string. Example 1:Given s = "hello", return "holle". Example 2:Given s 阅读全文
posted @ 2018-01-01 01:49 逸朵 阅读(119) 评论(0) 推荐(0)
摘要:Given the coordinates of four points in 2D space, return whether the four points could construct a square. The coordinate (x,y) of a point is represen 阅读全文
posted @ 2017-12-30 05:31 逸朵 阅读(118) 评论(0) 推荐(0)
摘要:Given a binary tree where every node has a unique value, and a target key k, find the value of the nearest leaf node to target k in the tree. Here, ne 阅读全文
posted @ 2017-12-30 01:06 逸朵 阅读(186) 评论(0) 推荐(0)
摘要:There is a box protected by a password. The password is n digits, where each letter can be one of the first k digits 0, 1, ..., k-1. You can keep inpu 阅读全文
posted @ 2017-12-29 07:58 逸朵 阅读(501) 评论(0) 推荐(0)

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