原创 leetcode筆記:Game of Life
一. 題目描述 According to the Wikipedia’s article: “The Game of Life, also known simply as Life, is a cellular automaton
原创 leetcode筆記:Coin Change
一. 題目描述 You are given coins of different denominations and a total amount of money amount. Write a function to comp
原创 leetcode筆記:Missing Number
一. 題目描述 Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from
原创 leetcode筆記:Increasing Triplet Subsequence
一. 題目描述 Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array. Fo
原创 leetcode筆記:Contains Duplicate III
一. 題目描述 Given an array of integers, find out whether there are two distinct indices i and j in the array such that
原创 leetcode筆記:Wiggle Sort
一. 題目描述 Given an unsorted array nums, reorder it in-place such that nums[0] <= nums[1] >= nums[2] <= nums[3]… For e
原创 leetcode筆記:Find the Duplicate Number
一. 題目描述 Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that
原创 leetcode筆記:Super Ugly Number
一. 題目描述 Write a program to find the nth super ugly number. Super ugly numbers are positive numbers whose all prime
原创 leetcode筆記:Longest Increasing Path in a Matrix
一. 題目描述 Given an integer matrix, find the length of the longest increasing path. From each cell, you can either mov
原创 leetcode筆記:Range Sum Query 2D - Immutable
一. 題目描述 Given a 2D matrix matrix, find the sum of the elements inside the rectangle defined by its upper left corne
原创 leetcode筆記:Bitwise AND of Numbers Range
一. 題目描述 Given a range [m, n] where 0 <= m <= n <= 2147483647, return the bitwise AND of all numbers in this range,
原创 leetcode筆記:H-Index II
一. 題目描述 Follow up for H-Index: What if the citations array is sorted in ascending order? Could you optimize your al
原创 leetcode筆記:Maximum Product of Word Lengths
一. 題目描述 Given a string array words, find the maximum value of length(word[i]) * length(word[j]) where the two words
原创 leetcode筆記:Contains Duplicate
一. 題目描述 Given an array of integers, find if the array contains any duplicates. Your function should return true if
原创 Unix NetWork Programming:配置unp.h頭文件環境
在閱讀Unix網絡編程(第三版)的過程中發現(UNP),書中的代碼只需要包含#include "unp.h"即可編譯,百度了一下,有不少配置unp.h頭文件環境的文章,因此試着操作了一下,以便自己日後查閱。 一、準備工作 下載源代