Home
Archive for
10/01/2018 - 11/01/2018
DB2 on Docker
RojerChen.2018.10.11
去年處理了一個跟 DB2 有關的案子,那個時候我跟同事分工,同事處理 DB2 的環境,我來處理 ASP.NET MVC 的開發環境,由於我不想在筆電上安裝 DB2,所以每次都只能等回到公司的時候在進行開發,雖然那個時候我知道可以安裝在 Docker 的環境上,但是因為太忙而遲遲沒有研究。
沒想到,脫離這個專案一年多的時間了,最近又回來處理這個專案。既然該躲的躲不過,還是來研究一下 DB2 要如何安裝在 Docker 環境,並且有哪些設定需要處理。
TDD LeetCode:832. Flipping an Image
RojerChen.2018.10.08
Given a binary matrix
Given a binary matrix
A
, we want to flip the image horizontally, then invert it, and return the resulting image.
To flip an image horizontally means that each row of the image is reversed. For example, flipping
[1, 1, 0]
horizontally results in [0, 1, 1]
.
To invert an image means that each
0
is replaced by 1
, and each 1
is replaced by 0
. For example, inverting [0, 1, 1]
results in [1, 0, 0]
.
Example 1:
Input: [[1,1,0],[1,0,1],[0,0,0]] Output: [[1,0,0],[0,1,0],[1,1,1]] Explanation: First reverse each row: [[0,1,1],[1,0,1],[0,0,0]]. Then, invert the image: [[1,0,0],[0,1,0],[1,1,1]]
Example 2:
Input: [[1,1,0,0],[1,0,0,1],[0,1,1,1],[1,0,1,0]] Output: [[1,1,0,0],[0,1,1,0],[0,0,0,1],[1,0,1,0]] Explanation: First reverse each row: [[0,0,1,1],[1,0,0,1],[1,1,1,0],[0,1,0,1]]. Then invert the image: [[1,1,0,0],[0,1,1,0],[0,0,0,1],[1,0,1,0]]
Notes:
1 <= A.length = A[0].length <= 20
0 <= A[i][j] <= 1
TDD LeetCode:905. Sort Array By Parity
RojerChen.2018.10.01
Given an array
A
of non-negative integers, return an array consisting of all the even elements of A
, followed by all the odd elements of A
.
You may return any answer array that satisfies this condition.
Example 1:
Input: [3,1,2,4] Output: [2,4,3,1] The outputs [4,2,3,1], [2,4,1,3], and [4,2,1,3] would also be accepted.
Note:
1 <= A.length <= 5000
0 <= A[i] <= 5000
訂閱:
文章
(
Atom
)