Olivia Liu Blog

Hello world to all the glorious developers.

Leetcode 200. Number of Islands

Lintcode 433. Number of Islands

Description Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically...

Leetcode 5. Longest Palindromic Substring

Lintcode 200. Longest Palindromic Substring

Description Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Answer The main idea is basically the same with valid palindrome, ...

Leetcode 409. Longest Palindrome

Lintcode 627. Longest Palindrome

Description Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters. This is case sensitive, for example "...

Leetcode 28. Implement strStr()

Lintcode 13. Implement strStr()

Description Implement strStr(). Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Answer The main idea of this problem is to first find th...

Leetcode 125. Valid Palindrome

Lintcode 415. Valid Palindrome

Description Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. Answer One of the most important feature of palindrome is adding the sam...

LeetCode 312. Burst Balloons

LintCode 168. Burst Balloons

Description Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all the balloons. If the you burst balloon i you ...

LeetCode 15. 3Sum

LintCode 168. 3Sum

Description Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero. Answer The time comp...

LeetCode 17. Letter Combinations of a Phone Number

LintCode 425. Letter Combinations of a Phone Number

Description Given a digit string excluded '0' and '1', return all possible letter combinations that the number could represent. Answer The main idea of this problem is using depth-first-search to...

OpenSSL Shell File Introduction

OpenSSL Shell文件代码介绍

gen.sh 文件代码解释 生成自签名证书(.pem): #生成RSA私钥和自签名证书,使用openssl-ca.cnf文件来配置生成的x509证书,证书私钥为4096位RSA加密,证书摘要采用SHA256哈希算法,-nodes不加密,-outform指定证书格式为.pem格式,证书名为cacert.pem openssl req -x509 -config openssl-ca.cnf...

Cloudflare Keyless SSL Protocol handshake workflow

Cloudflare keyless SSL协议握手流程

握手流程 RSA加密 在SSL协议的基础上,在使用私钥解密客户端发送至nGINX服务器的公钥加密后的pre-master时,服务器将该加密的pre-master发送给存储了私钥的key server,由key server进行解密后将解密完成的pre-master发回nGINX服务器,再进行后续的握手和对称加密流程。 Diffie-Hellman加密 在SSL协议的基础上,在收到...