随笔分类 -  算法题

上一页 1 2 3 4 5 6 7 8 ··· 16 下一页
摘要:You need to construct a string consists of parenthesis and integers from a binary tree with the preorder traversing way. The null node needs to be rep 阅读全文
posted @ 2017-08-07 19:19 Pickle 阅读(178) 评论(0) 推荐(0)
摘要:Given a group of two strings, you need to find the longest uncommon subsequence of this group of two strings. The longest uncommon subsequence is defi 阅读全文
posted @ 2017-08-07 17:54 Pickle 阅读(160) 评论(0) 推荐(0)
摘要:Given a non-empty binary tree, return the average value of the nodes on each level in the form of an array. Example 1: Input: 3 / \ 9 20 / \ 15 7 Outp 阅读全文
posted @ 2017-08-07 17:42 Pickle 阅读(214) 评论(0) 推荐(0)
摘要:In MATLAB, there is a very useful function called 'reshape', which can reshape a matrix into a new one with different size but keep its original data. 阅读全文
posted @ 2017-08-03 18:43 Pickle 阅读(153) 评论(0) 推荐(0)
摘要:Given an integer array with even length, where different numbers in this array represent different kinds of candies. Each number means one candy of th 阅读全文
posted @ 2017-08-03 18:25 Pickle 阅读(156) 评论(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 @ 2017-07-18 16:55 Pickle 阅读(393) 评论(0) 推荐(0)
摘要:Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), ..., (an, bn) which makes sum of 阅读全文
posted @ 2017-07-13 18:54 Pickle 阅读(214) 评论(0) 推荐(0)
摘要:Given a string, you need to reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order. E 阅读全文
posted @ 2017-07-13 18:27 Pickle 阅读(173) 评论(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 @ 2017-04-10 21:10 Pickle 阅读(1740) 评论(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 @ 2017-04-01 21:47 Pickle 阅读(585) 评论(0) 推荐(0)
摘要:Given a List of words, return the words that can be typed using letters of alphabet on only one row's of American keyboard 阅读全文
posted @ 2017-02-11 17:44 Pickle 阅读(323) 评论(0) 推荐(0)
摘要:Given a binary array, find the maximum number of consecutive 1s in this array. 阅读全文
posted @ 2017-01-20 11:31 Pickle 阅读(235) 评论(0) 推荐(0)
摘要:Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation. 阅读全文
posted @ 2017-01-20 11:15 Pickle 阅读(315) 评论(0) 推荐(0)
摘要:The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers x and y, calcul 阅读全文
posted @ 2017-01-20 10:31 Pickle 阅读(227) 评论(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 @ 2017-01-20 10:14 Pickle 阅读(294) 评论(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 @ 2016-10-18 21:07 Pickle 阅读(233) 评论(0) 推荐(0)
摘要:Write a program that outputs the string representation of numbers from 1 to n. But for multiples of three it should output “Fizz” instead of the numbe 阅读全文
posted @ 2016-10-18 21:00 Pickle 阅读(349) 评论(0) 推荐(0)
摘要:Given two non-negative numbers num1 and num2 represented as string, return the sum of num1 and num2. Note: 阅读全文
posted @ 2016-10-09 20:14 Pickle 阅读(383) 评论(0) 推荐(0)
摘要:Find the sum of all left leaves in a given binary tree. Example: 阅读全文
posted @ 2016-10-09 18:46 Pickle 阅读(416) 评论(0) 推荐(0)
摘要:Given two strings s and t which consist of only lowercase letters. String t is generated by random shuffling string s and then add one more letter at 阅读全文
posted @ 2016-10-09 00:09 Pickle 阅读(265) 评论(0) 推荐(0)

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