摘要:
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example: Input: "babad" Output: "b 阅读全文
摘要:
You are given two non empty linked lists representing two non negative integers. The digits are stored in reverse order and each of their nodes contai 阅读全文
摘要:
Given n non negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpo 阅读全文
摘要:
每日一道题目,预防思维僵化 Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which giv 阅读全文
摘要:
小明有n(1 using namespace std; int dp[2010][2010]; int main() { int n; while (cin n) { vector v(n); memset(dp, 0, sizeof dp); for (int i = 0; i v[i]; // 阅读全文
摘要:
Given a binary search tree and the lowest and highest boundaries as L and R, trim the tree so that all its elements lies in [L, R] (R = L). You might 阅读全文
摘要:
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. 阅读全文
摘要:
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. 阅读全文
摘要:
Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that there is a bijection between a lette 阅读全文