0%

前言

甚麼是創建者模式,將一個複雜對象的構建與他的表示分離,使得同樣的構建過程可以創建不同的表示。 一步一步創建一個複雜的對象,它允許用戶只通過指定複雜對象的類型和內容就可以建構它們,用戶不需要知道內部的具體建構細節。
建造者模式客戶端返回的不是一個簡單的產品,而是一個由多個部件組成的複雜產品。

閱讀全文 »

Difficult:Medium

題目

An n-bit gray code sequence is a sequence of 2n integers where:

Every integer is in the inclusive range [0, 2n - 1],
The first integer is 0,
An integer appears no more than once in the sequence,
The binary representation of every pair of adjacent integers differs by exactly one bit, and
The binary representation of the first and last integers differs by exactly one bit.
Given an integer n, return any valid n-bit gray code sequence.

閱讀全文 »

Difficult:Easy

題目

You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing the number of elements in nums1 and nums2 respectively.

Merge nums1 and nums2 into a single array sorted in non-decreasing order.

The final sorted array should not be returned by the function, but instead be stored inside the array nums1. To accommodate this, nums1 has a length of m + n, where the first m elements denote the elements that should be merged, and the last n elements are set to 0 and should be ignored. nums2 has a length of n.

閱讀全文 »

Qrcode 製作介紹

前言

現代人人手一支手機,因此只要有手機就能將Qrcode的內容,呈現在使用者的手機上,這樣不用使用者慢慢key網址,節省很多時間。

流程圖

result

撰寫產生Qrcode的程式

使用者掃Qrcode

將內容傳給使用者

閱讀全文 »