leetcode
peterkang202
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
leetcode: Binary Tree Level Order Traversal
Given a binary tree, return the level order traversal of its nodes’ values. (ie, from left to right, level by level).For example: Given binary tree {3,9,20,#,#,15,7}, 3 / \ 9 20 / \原创 2015-05-15 11:13:50 · 386 阅读 · 0 评论 -
leetcode: count and say
The count-and-say sequence is the sequence of integers beginning as follows: 1, 11, 21, 1211, 111221, …1 is read off as “one 1” or 11. 11 is read off as “two 1s” or 21. 21 is read off as “one 2, the原创 2015-05-14 17:56:31 · 408 阅读 · 0 评论 -
leetcode:two sum的三种解法
Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers such that they add up to the target, where in原创 2015-04-15 20:16:13 · 5568 阅读 · 0 评论 -
leetcode: Isomorphic Strings
class Solution { public: bool isIsomorphic(string s, string t) { if(s.empty() && t.empty()) return true; int sl = s.length(); int tl = t.length(); char *原创 2015-05-16 10:28:56 · 471 阅读 · 0 评论 -
LeetCode:Reorder List C++与Java实现
LeetCode:Reorder List 题目(题目链接): Given a singly linked list L: L0→L1→…→Ln-1→Ln, reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must do this in-place without altering the nodes' values. For example, G原创 2013-11-18 22:53:38 · 1159 阅读 · 0 评论 -
leetcode: basic caculator
Implement a basic calculator to evaluate a simple expression string.The expression string may contain open ( and closing parentheses ), the plus + or minus sign -, non-negative integers and empty space原创 2015-06-19 11:20:01 · 410 阅读 · 0 评论 -
N-Queens
The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other. Given an integer n, return all distinct solutions to the n-queens puzzle.原创 2015-06-10 10:00:10 · 457 阅读 · 0 评论 -
leetcode 218: The Skyline Problem
题目链接:(https://leetcode.com/problems/the-skyline-problem/)示例代码:public class Solution { public List<int[]> getSkyline(int[][] buildings) { List<int[]> res = new ArrayList<int[]>(); Pr原创 2015-07-03 17:04:26 · 861 阅读 · 0 评论
分享