LeetCode解题笔记
西二旗的小飞飞
还没去西二旗。。。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
[LeetCode-283] Move Zeroes
[LeetCode-283]Move Zeroes写在前面:待补充。。。Given an array nums, write a function to move all 0’s to the end of it while maintaining the relative order of the non-zero elements.For example, given nums = [0, 1,原创 2015-12-24 00:32:57 · 535 阅读 · 0 评论 -
[LeetCode-70] Climbing Stairs
[LeetCode-70] Climbing StairsYou are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?Solutio原创 2016-04-05 18:05:03 · 401 阅读 · 0 评论 -
[LeetCode-9] Palindrome Number
Determine whether an integer is a palindrome. Do this without extra space.Solution[C++]:class Solution {public: bool isPalindrome(int x) { if(x < 0) return false; int t原创 2016-04-10 13:52:47 · 423 阅读 · 0 评论 -
[LeetCode-230]Kth Smallest Element in a BST
Given a binary search tree, write a function kthSmallest to find the kth smallest element in it.Note: You may assume k is always valid, 1 ≤ k ≤ BST's total elements.Follow up:What if the BST is modif原创 2015-12-27 14:10:03 · 393 阅读 · 0 评论 -
[LeetCode-91] Decode Ways
A message containing letters from A-Z is being encoded to numbers using the following mapping:‘A’ -> 1 ‘B’ -> 2 … ‘Z’ -> 26 Given an encoded message containing digits, determine the total number of原创 2016-04-10 20:46:05 · 521 阅读 · 0 评论
分享