Description You are given n points on a line with their coordinates xi. Find the point x so the sum of distances to the given points is minimal. Descr ...
分类:
其他好文 时间:
2016-08-24 11:11:04
阅读次数:
97
A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down). Find all strobogrammatic numbers that are o ...
分类:
其他好文 时间:
2016-08-24 07:43:19
阅读次数:
123
Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longes ...
分类:
其他好文 时间:
2016-08-24 06:35:43
阅读次数:
197
题目描述: Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1. Examples: 解题思路: 开个26个数的数组,然后 ...
分类:
编程语言 时间:
2016-08-24 06:29:00
阅读次数:
1126
题目链接: C. Magic Odd Square Find an n?×?n matrix with different numbers from 1 to n2, so the sum in each row, column and both main diagonals are odd. Fi ...
分类:
其他好文 时间:
2016-08-23 23:29:53
阅读次数:
176
最近公司搬家了,有两天没写了,今天闲下来了,继续开始算法之路。 leetcode的题目如下: Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist ...
分类:
其他好文 时间:
2016-08-23 23:23:11
阅读次数:
170
依旧水题一道,两头往后滑动,用数组映射出现的字符就行。
Given a string, find the length of the longest substring without repeating characters.
Examples:
Given "abcabcbb", the answer is "abc",
which the length is 3.
...
分类:
其他好文 时间:
2016-08-23 22:11:25
阅读次数:
128
Given two strings, find the longest common subsequence (LCS). 最长公共子序列 Your code should return the length of LCS. Given two strings, find the longest c ...
分类:
其他好文 时间:
2016-08-23 22:02:59
阅读次数:
192
题目: Given a sorted array of integers, find the starting and ending position of a given target value. Your algorithm's runtime complexity must be in th ...
分类:
其他好文 时间:
2016-08-23 21:59:08
阅读次数:
123
题目
Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1.
Examples:
s = "leetcode"
return 0.
s = "loveleetcode",
return 2.
...
分类:
其他好文 时间:
2016-08-23 20:36:15
阅读次数:
199