原创 OpenSSL-SSL協議

一、OpenSSL簡介 OpenSSL是一個基於密碼學的安全開發包,整個軟件包大概可以分成三個主要的功能部分:SSL協議庫、應用程序以及密碼算法庫。OpenSSL的目錄結構自然也是圍繞這三個功能部分進行規劃的。OpenSSL提供的功能相當

原创 387. First Unique Character in a String

Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1. 簡單

原创 234. Palindrome Linked List

Given a singly linked list, determine if it is a palindrome. 簡單的使用棧,檢測是否迴文 /**  * Definition for singly-linked list.  *

原创 455. Assign Cookies

455.Assign Cookies Assume you are an awesome parent and want to give your children some cookies. But, you should give

原创 20. Valid Parentheses

Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid

原创 203. Remove Linked List Elements

Remove all elements from a linked list of integers that have value val. ExampleGiven: 1 --> 2 --> 6 --> 3 --> 4 --> 5

原创 290. Word Pattern

Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that th

原创 14. Longest Common Prefix

Write a function to find the longest common prefix string amongst an array of strings. 簡單思路,先獲得第一個字串,比較個字串,比較後的結果作爲下次比較

原创 獲取圖片顏色相同的最大塊,獲取二維數組中值上下左右連續相同的最大塊

問題:查找一塊圖片中區域顏色相同的最大的一塊,以二維數組模擬圖片,共有1、2、3、4四種顏色。 輸入:一個二維數組,每個值爲1、2、3、4中的一個。 輸出:最大塊顏色值及最大塊總數值。 主要思路: 參數設置: int a[10][10]

原创 122. Best Time to Buy and Sell Stock II

122. Best Time to Buy and Sell Stock II Say you have an array for which the ith element is the price of a given stock

原创 58. Length of Last Word

Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last wor

原创 38. Count and Say

The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ... 1 is read of

原创 190. Reverse Bits

Reverse bits of a given 32 bits unsigned integer. For example, given input 43261596 (represented in binary as 0000001

原创 19. Remove Nth Node From End of List

Given a linked list, remove the nth node from the end of list and return its head. For example, Given linked list:

原创 95. Unique Binary Search Trees II

Given an integer n, generate all structurally unique BST's (binary search trees) that store values 1...n. For exampl