326. Power of Three
463. Island Perimeter
题目
You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/vertically (not diagonally). The grid is completely surrounded by water, and there is exactly one island (i.e., one or more connected land cells). The island doesn’t have “lakes” (water inside that isn’t connected to the water around the island). One cell is a square with side length 1. The grid is rectangular, width and height don’t exceed 100. Determine the perimeter of the island.
Example:
[[0,1,0,0],
[1,1,1,0],
[0,1,0,0],
[1,1,0,0]]
Answer: 16
Explanation: The perimeter is the 16 yellow stripes in the image > below:
155. Min Stack
题目
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.
- push(x) – Push element x onto stack.
- pop() – Removes the element on top of the stack.
- top() – Get the top element.
- getMin() – Retrieve the minimum element in the stack.
Example:
MinStack minStack = new MinStack();
minStack.push(-2);
minStack.push(0);
minStack.push(-3);
minStack.getMin(); –> Returns -3.
minStack.pop();
minStack.top(); –> Returns 0.
minStack.getMin(); –> Returns -2.
66. Plus One
20. Valid Parentheses
657. Judge Route Circle
题目
Initially, there is a Robot at position (0, 0). Given a sequence of its moves, judge if this robot makes a circle, which means it moves back to the original place.
The move sequence is represented by a string. And each move is represent by a character. The valid robot moves are R (Right), L (Left), U (Up) and D (down). The output should be true or false representing whether the robot makes a circle.
Example 1:
Input: “UD”
Output: true
Example 2:
Input: “LL”
Output: false
8皇后问题
760 Find Anagram Mappings
题目
Given two lists Aand B
, and B
is an anagram of A
. B
is an anagram of A
means B
is made by randomizing the order of the elements in A
.
We want to find an index mapping P
, from A
to B
. A
mapping P[i] = j
means the ith element in A
appears in B
at index j
.
These lists A
and B
may contain duplicates. If there are multiple answers, output any of them.
For example, given
A = [12, 28, 46, 32, 50]
B = [50, 12, 32, 46, 28]
We should return
[1, 4, 3, 2, 0]
as P[0] = 1
because the 0th element of A appears at B[1]
, and P[1] = 4
because the 1st element of A
appears at B[4]
, and so on.
Note:
- A, B have equal lengths in range [1, 100].
- A[i], B[i] are integers in range [0, 10^5].
react-navigation和react-native-navigation
写项目的时候肯定会遇到实现类似于iOS 的Navigation Controller或者Tab bar之类的界面。官方只有一个NavigatorIOS
的控件可以用,但是这个控件只能用在iOS平台,安卓的要另外重写,十分鸡肋。所以官方还提供了两个控件可以选择:react-navigation 和 react-native-navigation。这两个的区别我感觉网上写的很少,所以写这篇博客来记下两个区别。。。
当然如果懒得看完,可以直接用这个结论:
用 react-navigation!!!
好用的多!!!