胡言乱语

记录一些无聊的日常


Leetcode05

Published at March 5, 2019 ·  1 min read

Merge k Sorted Lists Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Example Input: [ 1->4->5, 1->3->4, 2->6 ] Output: 1->1->2->3->4->4->5->6 合并n个有序链表,第一眼看到觉的很简单,想怎么实现的时候头大,大体思路是全部都放到一个list里,然后排序list,再转链表 class Solution(object): def mergeKLists(self, lists): """ :type lists: List[ListNode] :rtype: ListNode """ merged_list = [] for head in lists: while head: merged_list....

Leetcode04

Published at March 5, 2019 ·  2 min read

Add Two Numbers You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list. You may assume the two numbers do not contain any leading zero, except the number 0 itself....

Leetcode03

Published at March 3, 2019 ·  1 min read

Palindrome Number Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward. Example 1: Input: 121 Output: true Example 2: Input: -121 Output: false Explanation: From left to right, it reads -121. From right to left, it becomes 121-....

Git 子模块使用

Published at March 2, 2019 ·  1 min read

Submodule解决了什么问题 当你的项目里依赖与一个第三方模块,或者一个子项目,而你需要保持这个模块的更新,确保使用这个子模块的所有项目都能同步到,如果拷贝的话就达不到这个目的,总之一句话就是在一个库里可以包含多个子库,并且主库和子库是隔离的,互不影响. 如何使用 我们现在新建一个库叫 parent git clone git@github.com:hurryking/parent.git 然后在 parent 下新建一个目录 children cd parent mkdir children 进入 children 执行 cd children git submodule add git@github.com:hurryking/let-s-go.git 然后在 parent 下就能看到刚才加的子库,还有一个 .gitmodules 文件,里面记录着子库的在这个项目的路径和远程仓库的地址 然后提交这次的改动 git commit -am "added submoudle let's go" 推送到远程仓库 git push -u origin master(由于是第一次入库需要设置下默认上游) 然后我们修改下子库,提交...

Leetcode02

Published at March 1, 2019 ·  2 min read

Implement atoi which converts a string to an integer. The function first discards as many whitespace characters as necessary until the first non-whitespace character is found. Then, starting from this character, takes an optional initial plus or minus sign followed by as many numerical digits as possible, and interprets them as a numerical value....

Leetcode01

Published at February 28, 2019 ·  1 min read

Valid Square Given the coordinates of four points in 2D space, return whether the four points could construct a square. The coordinate (x,y) of a point is represented by an integer array with two integers. Example: Input: p1 = [0,0], p2 = [1,1], p3 = [1,0], p4 = [0,1] Output: True Note: All the input integers are in the range [-10000, 10000]....

如何科学上网

Published at February 23, 2019 ·  2 min read

墙的工作方式 维基百科简介 等你翻过去就知道了 ^_^ 如何科学上网 需要准备的东西 购买vps(建议买国外的,国内受监管) 如果有就跳过此步 推荐购买地址 (建议先买5$/month没,一般需求应该够了,没必要选25$的) 服务端要求的要求操作系统为Ubuntu 16+ / Debian 8+ / CentOS 7+,所以vps选操作系统时注意下不要选错了 购买域名(建议买国外的,国内需要很长的备案时间) 推荐godaddy 购买完成后记得配置好DNS,把域名指向刚才购买的域名的外网ip,在这里假设购买的域名为 example.com (大家记得修改成自己购买的域名不要直接复制) DNS相关知识 希望能帮到你 paypal账号(为了结账 注册地址) 如果有迷惑的这个是官方的帮助链接 希望能帮到你 一定的时间和耐心 顺利的话大约一个小时 vps购买好以后, 需要安装的软件分服务端和客户端 安装服务端 我们先来安装服务端软件 服务端需要安装的软件 nginx(用来转发流量,起混淆作用) v2ray(充当代理角色) 下面来给出一副图说明下基本工作原理 ​ 以下所有操作建议用root执行...


Recent posts

Leetcode30

ElasticSearch 系列(一)

Mysql 分区表实践

Kafka 入门

Hugo 安装


Archives

2020 (11)
2019 (56)