摘要: 来源:https://leetcode.com/problems/symmetric-tree Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For exa 阅读全文
posted @ 2017-09-13 20:55 HitAnyKey 阅读(234) 评论(0) 推荐(0) 编辑
摘要: 来源:https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree Given a binary tree, find the lowest common ancestor (LCA) of two given nodes 阅读全文
posted @ 2017-09-12 21:15 HitAnyKey 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 来源:https://leetcode.com/problems/reverse-linked-list Reverse a singly linked list. 递归方法:递归调用直到最后一个节点再开始反转,注意保存反转后的头结点返回 Java Python 迭代方法:两个指针从头开始依次反转, 阅读全文
posted @ 2017-09-10 10:03 HitAnyKey 阅读(724) 评论(0) 推荐(0) 编辑
摘要: 来源:https://leetcode.com/problems/implement-queue-using-stacks Implement the following operations of a queue using stacks. push(x) -- Push element x to 阅读全文
posted @ 2017-09-09 16:31 HitAnyKey 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 判断链表中是否有环 来源:https://leetcode.com/problems/linked list cycle Given a linked list, determine if it has a cycle in it. 一块一慢两个指针,如果有环,两个指针必定会在某个时刻相同且都不为空 阅读全文
posted @ 2017-09-09 13:53 HitAnyKey 阅读(255) 评论(0) 推荐(0) 编辑
摘要: 来源:https://www.nowcoder.com/questionTerminal/94a4d381a68b47b7a8bed86f2975db46 给定一个数组A[0,1,...,n 1],请构建一个数组B[0,1,...,n 1],其中B中的元素B[i]=A[0] A[1] ... A[i 阅读全文
posted @ 2017-09-08 19:00 HitAnyKey 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 来源:https://leetcode.com/problems/intersection of two linked lists Write a program to find the node at which the intersection of two singly linked list 阅读全文
posted @ 2017-09-04 21:57 HitAnyKey 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 来源:https://leetcode.com/problems/maximum subarray Find the contiguous subarray within an array (containing at least one number) which has the largest 阅读全文
posted @ 2017-09-04 09:03 HitAnyKey 阅读(241) 评论(0) 推荐(0) 编辑
摘要: 参考:https://minenet.me/2016/08/24/quickSort.html 快速排序 利用分治法可将快速排序的分为三步: 1. 在数据集之中,选择一个元素作为”基准”。 2. 所有小于”基准”的元素,都移到”基准”的左边;所有大于”基准”的元素,都移到”基准”的右边。这个操作称为 阅读全文
posted @ 2017-09-03 11:20 HitAnyKey 阅读(2888) 评论(0) 推荐(0) 编辑
摘要: 统计一个整数在排序(升序)整数数组中出现的次数。 二分查找,分别查找大于目标值0.5(随便一个大于0小于1的数即可)和小于目标值0.5的数,取两位置之差。 Python Java 阅读全文
posted @ 2017-09-01 17:51 HitAnyKey 阅读(431) 评论(0) 推荐(0) 编辑
摘要: 来源:https://leetcode.com/problems/convert a number to hexadecimal Given an integer, write an algorithm to convert it to hexadecimal. For negative integ 阅读全文
posted @ 2017-08-31 20:41 HitAnyKey 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 来源:https://leetcode.com/problems/climbing stairs You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 阅读全文
posted @ 2017-08-30 21:41 HitAnyKey 阅读(272) 评论(0) 推荐(0) 编辑
摘要: 题目:一个整型数组里除了两个数字之外,其他的数字都出现了两次。请写程序找出这两个只出现一次的数字。 Python代码 Java代码 阅读全文
posted @ 2017-08-29 21:35 HitAnyKey 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 1. 去掉首位空格 2. 判断首位是否有正负号 3. 判断各位是否是0~9,有其他字符直接返回当前结果 1 public class Solution { 2 public int atoi(String str) { 3 str = str.trim(); 4 int result = 0; 5 阅读全文
posted @ 2017-08-29 20:37 HitAnyKey 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 有一台Linux服务器没有公网IP,但是我希望能够随时使用SSH连接它,即使是与它不在同一个网络中的时候,因此我从网上查找了几种方法,并根据自己的需求进行了设置。当然,首先得有一台具有公网IP的服务器。 为了方便说明,假设A是我想访问的目标机器,只有局域网IP(如192.168.1.10),B是一台 阅读全文
posted @ 2017-05-18 21:25 HitAnyKey 阅读(2308) 评论(0) 推荐(0) 编辑
摘要: ```Python !/usr/bin/env python coding:utf 8 Queen Attack https://hihocoder.com/problemset/problem/1497 Author: kngxscn Date: 2017 04 22 """ 时间限制:10000 阅读全文
posted @ 2017-04-22 10:31 HitAnyKey 阅读(306) 评论(0) 推荐(0) 编辑
摘要: 平时访问网站或者做 CTF 题的时候会遇到网站限制访问的问题,下面是一些小技巧,主要是通过 BurpSuite 拦截 HTTP 请求并根据需要修改 HTTP 请求头的内容来达到绕过的目的 看起来只允许国外访问,有可能是 HTTP 请求头中的 Accept Language 为中文(cn zh),修改 阅读全文
posted @ 2016-07-15 10:51 HitAnyKey 阅读(3949) 评论(0) 推荐(0) 编辑
摘要: 地址: 脚本关 1. key又又找不到了 点击提供的链接后,实际发生了两次跳转,key 在第一次跳转的网页中, 2. 快速口算 要求2秒内提交结果,肯定不能手动算了,写程序获取算式并计算出结果提交 运行得到答案 3. 这个题目是空的 什么才是空的呢?答案是 4. 怎么就是不弹出key呢? 点击之后没 阅读全文
posted @ 2016-06-28 22:39 HitAnyKey 阅读(4410) 评论(0) 推荐(0) 编辑
摘要: 网址: 第一关 突破客户端 :无论输入什么密码都会提示“密码不能为空”,使用浏览器检查网页元素会发现提交时会触发 javascript 函数 chk_submit(),查看该函数的代码发现始终返回 ,于是我们在浏览器的 Console 中将函数的返回值改为 ,即输入 ,再在输入框中输入密码 就行了。 阅读全文
posted @ 2016-06-27 13:07 HitAnyKey 阅读(1590) 评论(0) 推荐(0) 编辑
摘要: 地址: 基础关 1. key在哪里? 很简单,点击过关地址,在新打开的网页中查看网页源代码就能在 HTML 注释中发现 key 2. 再加密一次你就得到key啦~ 明文加密一次得到密文,密文再加密一次得到明文,这样的加密方式是“ROT13”,将“xrlvf23xfqwsxsqf”在加密一次得到 3. 阅读全文
posted @ 2016-06-26 22:36 HitAnyKey 阅读(2724) 评论(0) 推荐(0) 编辑