Stephen.Ri Blog

You are waiting for a train, a train that will take you far away!

[Learning]C++语法

  "C++中的一些语法使用"

extern 全局变量 在.h头文件中声明extern,如 extern int tmp; 在.cpp文件中定义变量,如 int tmp = 1; unordered_map unordered_map 与map类似,都是存储key-value的值,可以通过key快速检索到value。 不同的是unordered_map不会根据key的大小进行排序,即map中的元素是按照二叉搜索树...

[LeetCode]529. Minesweeper

  "扫雷游戏"

Description Let’s play the minesweeper game (Wikipedia, online game)! You are given a 2D char matrix representing the game board. ‘M’ represents an unrevealed mine, ‘E’ represents an unrevealed e...

[iRead]猎场电视剧

  "一部台词鸡汤剧"

《猎场》这部电视剧从听说到上映,足足等了两年。好在好剧不怕等。我最喜欢的在于这部剧的台词,特此记录一下。 眼前解决不了的问题,都可交付未来。时间是一个伟大的作者,它必将写出最完美的答案! 邪正看眼鼻,真假看嘴唇,功名看气概,富贵看精神——曾国藩 中学治身心,西学应世事 坏人也做好事,好人也做坏事。所以不必想自己是好...

[LeetCode]46. Permutations

  "求给定数组的全排列"

Description Given a collection of distinct numbers, return all possible permutations. Example [1,2,3] have the following permutations: [ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2],...

[iRead]大雪中的山庄-东野圭吾

  "新·无人生还"

《大雪中的山庄》这本书最开始读的时候感觉不就是《无人生还》的翻版嘛,你还能玩出什么花样。读完之后才发现东野圭吾构建的三重构造戏中戏中戏,真的是精彩,不落俗套。 第一重戏:东乡导演要求7位演员在大雪中的山庄中排演。 第二重戏:麻仓小姐拟定了二重构造复仇计划。 第三重戏:本多与笠原,元村和雨宫合谋上演假复仇给麻仓看。 身处残酷的处境时,人就会抢着说消极绝望的话,内心却期待...

[WALL]使用亚马逊云服务AWS搭建Shadowsocks

  "如何用AWS走出WALL看世界"

1.注册AWS AWS:https://amazonaws-china.com 常规注册操作。需要注意的是AWS的注册需要使用信用卡。 完成后的界面如下: 点击左上角服务,选择EC2,点击右上角,选择亚太地区(东京)。然后点击启动实例。 选择ubuntu系统,下一步点击审核和启动,启动。 在密钥下拉框选择创建新密钥,名称随意,如myawskey,然后下载密钥对(myaws...

[LeetCode]41. First Missing Positive

  "查找缺失的第一个整数"

Description Given an unsorted integer array, find the first missing positive integer. Your algorithm should run in O(n) time and uses constant space. Example Given [1,2,0] return 3, and [3,4...

[LeetCode]37. Sudoku Solver

  "完成一个数独游戏"

Description Write a program to solve a Sudoku puzzle by filling the empty cells. Empty cells are indicated by the character ‘.’. You may assume that there will be only one unique solution. A ...

[LeetCode]36. Valid Sudoku

  "判断一个矩阵是否满足数独游戏规则"

Description Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules. The Sudoku board could be partially filled, where empty cells are filled with the character ‘.’. A partial...

[LeetCode]34. Search for a Range

  "在一个有序数组中,搜索一个目标的起止位置"

Description Given an array of integers sorted in ascending order, find the starting and ending position of a given target value. Your algorithm’s runtime complexity must be in the order of O(log ...