NOTE


  • 首页

  • 分类

  • 关于

  • 归档

  • 标签

Single Number II

发表于 2016-08-30   |   分类于 LeetCode , Array , Bit Manipulation

Given an array of integers, every element appears three times except for one. Find that single one.

阅读全文 »

Remove Element

发表于 2016-08-30   |   分类于 LeetCode , Array

Given an array and a value, remove all instances of that value in place and return the new length.
Do not allocate extra space for another array, you must do this in place with constant memory.
The order of elements can be changed. It doesn’t matter what you leave beyond the new length.

阅读全文 »

Next Permutation

发表于 2016-08-24   |   分类于 LeetCode , Array

Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.
If such arrangement is not possible, it must rearrange it as the lowest possible order (ie, sorted in ascending order).
The replacement must be in-place, do not allocate extra memory.
Here are some examples. Inputs are in the left-hand column and its corresponding outputs are in the right-hand column.
1,2,3 → 1,3,2
3,2,1 → 1,2,3
1,1,5 → 1,5,1

阅读全文 »

Trapping Rain Water

发表于 2016-08-22   |   分类于 LeetCode , Array

Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.

阅读全文 »

N-Queens

发表于 2016-08-17   |   分类于 LeetCode , Array , Backtracking , Bit Manipulation

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.

阅读全文 »
1…789…13
denglyan

denglyan

めざせポケモンマスター

63 日志
31 分类
26 标签
© 2016 - 2018 denglyan
由 Hexo 强力驱动
主题 - NexT.Mist