xiajibaxie
文章平均质量分 69
xiaozaza2
爱情催化剂
展开
-
弟中弟的Leetcode总结——数组类(一)
弟中弟的Leetcode总结——数组类(一) 题目描述 There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+...原创 2018-08-18 22:44:26 · 178 阅读 · 0 评论 -
手写一个Linux下的debug工具(一)
写在前面 学习过Linux编程的同学都或多或少用过gdb来调试自己的程序,但是并没有很多的资源让我们学习有关调试器的东西。希望通过这篇文章,你可以了解基本的调试原理,更重要的是可以写出一个自己的简易调试工具。更有趣的是,你可以了解如何修改内存,来“愚弄”你的系统。 代码环境 系统:Ubuntu 16.04lts 语言:C++14 必要的库:readline 启动debug 在进行调试前,首先要执...原创 2018-09-23 11:12:51 · 496 阅读 · 0 评论 -
弟中弟的Leetcode总结——字符串类(一)
弟中弟的Leetcode总结——字符串类(一) 题目描述 Longest Substring Given a string, find the length of the longest substring without repeating characters. Example 1: Input: “abcabcbb” Output: 3 Explanation: The an...原创 2018-08-29 23:15:06 · 184 阅读 · 0 评论 -
弟中弟的Leetcode总结——数组类(九)
弟中弟的Leetcode总结——数组类(九) 题目描述 Subsets Given a set of distinct integers, nums, return all possible subsets (the power set). Note: The solution set must not contain duplicate subsets. Example: Inp...原创 2018-08-24 21:09:37 · 153 阅读 · 0 评论 -
弟中弟的Leetcode总结——数组类(十二)
弟中弟的Leetcode总结——数组类(十二) 题目描述 Target Sum You are given a list of non-negative integers, a1, a2, …, an, and a target, S. Now you have 2 symbols + and -. For each integer, you should choose one from...原创 2018-08-31 11:15:32 · 183 阅读 · 0 评论 -
弟中弟的Leetcode总结——数组类(十)
弟中弟的Leetcode总结——数组类(十) 题目描述 Climbing Stairs You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you cl...原创 2018-08-31 04:25:53 · 127 阅读 · 0 评论 -
弟中弟的Leetcode总结——数组类(十一)
弟中弟的Leetcode总结——数组类(十一) 题目描述 Single Number Given a non-empty array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runti...原创 2018-08-31 03:52:16 · 146 阅读 · 0 评论 -
弟中弟的Leetcode总结——数组类(七)
弟中弟的Leetcode总结——数组类(七) 题目描述 Maximum Subarray Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. Example: ...原创 2018-08-20 19:54:57 · 183 阅读 · 0 评论 -
弟中弟的Leetcode总结——数组类(八)
弟中弟的Leetcode总结——数组类(八) 题目描述 Combination Sum Given a set of candidate numbers (candidates) (without duplicates) and a target number (target), find all unique combinations in candidates where the c...原创 2018-08-23 08:27:42 · 177 阅读 · 0 评论 -
弟中弟的Leetcode总结——数组类(六)
弟中弟的Leetcode总结——数组类(五) 题目描述 3Sum Closest Given an array nums of n integers and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of the three i...原创 2018-08-19 19:51:05 · 148 阅读 · 0 评论 -
弟中弟的Leetcode总结——数组类(五)
弟中弟的Leetcode总结——数组类(五) 题目描述 Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length. Do not allocate extra space for another arra...原创 2018-08-19 10:56:59 · 152 阅读 · 0 评论 -
弟中弟的Leetcode总结——数组类(四)
弟中弟的Leetcode总结——数组类(四) 题目描述 Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solutio...原创 2018-08-19 09:53:49 · 142 阅读 · 0 评论 -
弟中弟的Leetcode总结——数组类(二)
弟中弟的Leetcode总结——数组类(二) 题目描述 Given n non-negative integers a1, a2, …, an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at ...原创 2018-08-18 23:14:58 · 133 阅读 · 0 评论 -
弟中弟的Leetcode总结——数组类(三)
弟中弟的Leetcode总结——数组类(三) 题目描述 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. Note:...原创 2018-08-19 02:12:17 · 146 阅读 · 0 评论 -
手写一个Linux下的debug工具()
断点 在这篇文章中,我们要在已有的基础上为程序增加设置断点的功能。 中断是怎么形成的 我们知道,有两种生成中断的方法:硬件中断和软件中断。 硬件中断顾名思义是指通过硬件的输入(如键盘、鼠标)使得相应的寄存器值发生变化,从而中断当前的程序;软件中断则涉及到了修改正在执行的代码。软件中断也称为陷阱 在下面我们会专注于软件中断,也就是生成断点。 在介绍代码之前,请先自己思考如下三个问题 1、如何修改正在...原创 2018-09-24 07:55:49 · 295 阅读 · 0 评论