摘要: Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction 阅读全文
posted @ 2019-02-25 09:47 月半榨菜 阅读(144) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest le 阅读全文
posted @ 2019-02-25 09:46 月半榨菜 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 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 cli 阅读全文
posted @ 2019-02-25 09:45 月半榨菜 阅读(102) 评论(0) 推荐(0) 编辑
摘要: Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. Example: Foll 阅读全文
posted @ 2019-02-25 09:43 月半榨菜 阅读(118) 评论(0) 推荐(0) 编辑
摘要: Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. Example: 阅读全文
posted @ 2019-02-25 09:41 月半榨菜 阅读(88) 评论(0) 推荐(0) 编辑
摘要: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: No 阅读全文
posted @ 2019-02-25 09:26 月半榨菜 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 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 contai 阅读全文
posted @ 2019-02-25 09:23 月半榨菜 阅读(83) 评论(0) 推荐(0) 编辑
摘要: 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 exa 阅读全文
posted @ 2019-02-25 09:13 月半榨菜 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 1. TwoSum https://www.cnblogs.com/zhacai/p/10429120.html easy 2. Add Two Numbers https://www.cnblogs.com/zhacai/p/10429155.html easy 15.3Sum https://w 阅读全文
posted @ 2019-02-18 15:03 月半榨菜 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 概念 1. 原码 即当前数字的二进制表现形式,其中第一位为符号位; +1 原码为 0000 0001 -1 原码为 1000 0001 2.反码 正数的反码就是原码,负数的反码是符号位不变,其余位取反; +1 反码为 0000 0001 -1 反码为 1111 1110 3. 补码 正数的补码就是原 阅读全文
posted @ 2018-09-06 09:51 月半榨菜 阅读(239) 评论(0) 推荐(1) 编辑