随笔分类 -  LeetCode

摘要:问题描述 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 endpoints of line i is at (i, ai) and (i, 0). Find... 阅读全文
posted @ 2016-12-03 09:38 marcusxu 阅读(182) 评论(0) 推荐(0)
摘要:题目 Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the l 阅读全文
posted @ 2016-05-31 21:02 marcusxu 阅读(107) 评论(0) 推荐(0)
摘要:题目 You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a sing 阅读全文
posted @ 2016-05-31 17:02 marcusxu 阅读(137) 评论(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 阅读全文
posted @ 2016-05-31 15:07 marcusxu 阅读(187) 评论(0) 推荐(0)
摘要:题目 Implement a basic calculator to evaluate a simple expression string. The expression string contains only non-negative integers, +, -, *, / operator 阅读全文
posted @ 2016-05-08 19:09 marcusxu 阅读(223) 评论(0) 推荐(0)
摘要:题目 Given an integer matrix, find the length of the longest increasing path. From each cell, you can either move to four directions: left, right, up or 阅读全文
posted @ 2016-04-28 18:54 marcusxu 阅读(220) 评论(0) 推荐(0)
摘要:问题: Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. Example:Given nums = [-2, 0, 3, -5, 2, -1] sumRange(0, 2) -> 1 sumRange(2, 5) -> -1 sumRang... 阅读全文
posted @ 2016-04-26 18:57 marcusxu 阅读(467) 评论(0) 推荐(0)