
算法导论
文章平均质量分 65
ginxal
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Evaluate Division
这周是做Graph相关的问题 Equations are given in the format A / B = k, where A and B are variables represented as strings, and k is a real number (floating point number). Given some queries, return原创 2017-09-24 18:15:02 · 208 阅读 · 0 评论 -
Find Mode in Binary Search Tree
Given a binary search tree (BST) with duplicates, find all the mode(s) (the most frequently occurred element) in the given BST. Assume a BST is defined as follows: The left subtree of a node c原创 2018-01-12 13:59:26 · 178 阅读 · 0 评论 -
Optimal Division
Given a list of positive integers, the adjacent integers will perform the float division. For example, [2,3,4] -> 2 / 3 / 4. However, you can add any number of parenthesis at any position to change原创 2018-01-12 13:54:50 · 179 阅读 · 0 评论 -
Reverse Words in a String III
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. Example 1: Input: "Let's take LeetCode contest"原创 2018-01-12 13:53:19 · 199 阅读 · 0 评论 -
Array Partition I
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 min(ai, bi) for all i from 1 to n as large as poss原创 2018-01-12 13:51:48 · 162 阅读 · 0 评论 -
Judge Route Circle
Initially, there is a Robot at position (0, 0). Given a sequence of its moves, judge if this robot makes a circle, which means it moves back to the original place. The move sequence is represented原创 2017-12-28 10:30:50 · 161 阅读 · 0 评论 -
Second Minimum Node In a Binary Tree
Given a non-empty special binary tree consisting of nodes with the non-negative value, where each node in this tree has exactly two or zero sub-node. If the node has two sub-nodes, then this node's原创 2017-12-28 10:27:50 · 169 阅读 · 0 评论 -
Valid Palindrome II
Given a non-empty string s, you may delete at most one character. Judge whether you can make it a palindrome. Example 1: Input: "aba" Output: True Example 2: Input: "abca" Output: True Ex原创 2017-12-28 10:21:24 · 180 阅读 · 0 评论 -
Repeated String Match
Given two strings A and B, find the minimum number of times A has to be repeated such that B is a substring of it. If no such solution, return -1. For example, with A = "abcd" and B = "cdabcdab".原创 2017-12-28 10:18:23 · 215 阅读 · 0 评论 -
Longest Word in Dictionary
Given a list of strings words representing an English Dictionary, find the longest word in words that can be built one character at a time by other words in words. If there is more than one possible原创 2017-12-27 23:23:52 · 306 阅读 · 0 评论 -
Find Pivot Index
Given an array of integers nums, write a method that returns the "pivot" index of this array. We define the pivot index as the index where the sum of the numbers to the left of the index is equal t原创 2017-12-27 20:58:22 · 220 阅读 · 0 评论 -
Self Dividing Numbers
A self-dividing number is a number that is divisible by every digit it contains. For example, 128 is a self-dividing number because 128 % 1 == 0, 128 % 2 == 0, and 128 % 8 == 0. Also, a self-div原创 2017-12-27 20:53:37 · 170 阅读 · 0 评论 -
Number of Boomerangs
Given n points in the plane that are all pairwise distinct, a "boomerang" is a tuple of points (i, j, k) such that the distance between i and j equals the distance between i and k (the order of the原创 2018-01-12 14:01:19 · 207 阅读 · 0 评论