• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
xiaoba1203
记录leetcode之路
博客园 | 首页 | 新随笔 | 新文章 | 联系 | 订阅 订阅 | 管理

随笔分类 -  leetcode

上一页 1 2 3 4 5 6 7 ··· 9 下一页

leetcode 历程
 
✡ leetcode 170. Two Sum III - Data structure design 设计two sum模式 --------- java
摘要:Design and implement a TwoSum class. It should support the following operations: add and find. Design and implement a TwoSum class. It should support 阅读全文
posted @ 2016-11-30 17:15 xiaoba1203 阅读(181) 评论(0) 推荐(0)
✡ leetcode 169. Majority Element 求出现次数最多的数 --------- java
摘要:Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume that the 阅读全文
posted @ 2016-11-30 15:53 xiaoba1203 阅读(486) 评论(0) 推荐(0)
✡ leetcode 168. Excel Sheet Column Title 26进制数字 --------- java
摘要:Given a positive integer, return its corresponding column title as appear in an Excel sheet. For example: 26进制的实现。 没什么难点。就是需要需要注意是 n = (n-1)/26 阅读全文
posted @ 2016-11-30 15:12 xiaoba1203 阅读(287) 评论(0) 推荐(0)
✡ leetcode 167. Two Sum II - Input array is sorted 求两数相加等于一个数的位置 --------- java
摘要:Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number. The function 阅读全文
posted @ 2016-11-30 14:48 xiaoba1203 阅读(143) 评论(0) 推荐(0)
✡ leetcode 166. Fraction to Recurring Decimal 分数转换 --------- java
摘要:Given two integers representing the numerator and denominator of a fraction, return the fraction in string format. If the fractional part is repeating 阅读全文
posted @ 2016-11-30 14:35 xiaoba1203 阅读(167) 评论(0) 推荐(0)
✡ leetcode 165. Compare Version Numbers 比较两个字符串数字的大小 --------- java
摘要:Compare two version numbers version1 and version2.If version1 > version2 return 1, if version1 < version2 return -1, otherwise return 0. You may assum 阅读全文
posted @ 2016-11-29 16:58 xiaoba1203 阅读(10055) 评论(0) 推荐(0)
✡ leetcode 164. Maximum Gap 寻找最大相邻数字差 --------- java
摘要:Given an unsorted array, find the maximum difference between the successive elements in its sorted form. Try to solve it in linear time/space. Return 阅读全文
posted @ 2016-11-29 16:11 xiaoba1203 阅读(311) 评论(0) 推荐(0)
✡ leetcode 163. Missing Ranges 找出缺失范围 --------- java
摘要:Given a sorted integer array where the range of elements are in the inclusive range [lower, upper], return its missing ranges. For example, given [0, 阅读全文
posted @ 2016-11-29 14:30 xiaoba1203 阅读(261) 评论(0) 推荐(0)
✡ leetcode 161. One Edit Distance 判断两个字符串是否是一步变换 --------- java
摘要:Given two strings S and T, determine if they are both one edit distance apart. 给定两个字符串,判断他们是否是一步变换得到的。 在这里需要注意几点: 1、不等于1的变换都要返回false(包括变换次数等于0)。 2、还有很 阅读全文
posted @ 2016-11-28 23:06 xiaoba1203 阅读(630) 评论(0) 推荐(0)
✡ leetcode 159. Longest Substring with At Most Two Distinct Characters 求两个字母组成的最大子串长度 --------- java
摘要:Given a string, find the length of the longest substring T that contains at most 2 distinct characters. For example, Given s = “eceba”, T is "ece" whi 阅读全文
posted @ 2016-11-28 17:14 xiaoba1203 阅读(381) 评论(0) 推荐(0)
✡ leetcode 158. Read N Characters Given Read4 II - Call multiple times 对一个文件多次调用read(157题的延伸题) --------- java
摘要:The API: int read4(char *buf) reads 4 characters at a time from a file. The return value is the actual number of characters read. For example, it retu 阅读全文
posted @ 2016-11-28 15:11 xiaoba1203 阅读(341) 评论(0) 推荐(0)
✡ leetcode 157. Read N Characters Given Read4 利用read4实现read --------- java
摘要:The API: int read4(char *buf) reads 4 characters at a time from a file. The return value is the actual number of characters read. For example, it retu 阅读全文
posted @ 2016-11-28 14:20 xiaoba1203 阅读(508) 评论(0) 推荐(0)
✡ leetcode 156. Binary Tree Upside Down 旋转树 --------- java
摘要:156. Binary Tree Upside Down Add to List QuestionEditorial Solution My Submissions 156. Binary Tree Upside Down Add to List QuestionEditorial Solution 阅读全文
posted @ 2016-11-28 12:56 xiaoba1203 阅读(283) 评论(0) 推荐(0)
✡ leetcode 162. Find Peak Element --------- java
摘要:A peak element is an element that is greater than its neighbors. Given an input array where num[i] ≠ num[i+1], find a peak element and return its inde 阅读全文
posted @ 2016-11-19 23:38 xiaoba1203 阅读(220) 评论(0) 推荐(0)
✡ leetcode 160. Intersection of Two Linked Lists 求两个链表的起始重复位置 --------- java
摘要:Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists: begin to in 阅读全文
posted @ 2016-11-19 23:20 xiaoba1203 阅读(223) 评论(0) 推荐(0)
leetcode 155. Min Stack --------- java
摘要:Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) -- Push element x onto stack. pop() -- Remov 阅读全文
posted @ 2016-11-19 15:45 xiaoba1203 阅读(320) 评论(0) 推荐(0)
leetcode 154. Find Minimum in Rotated Sorted Array II --------- java
摘要:Follow up for "Find Minimum in Rotated Sorted Array":What if duplicates are allowed? Would this affect the run-time complexity? How and why? Suppose a 阅读全文
posted @ 2016-11-19 14:55 xiaoba1203 阅读(132) 评论(0) 推荐(0)
leetcode 153. Find Minimum in Rotated Sorted Array --------- java
摘要:Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). Find the minimum element. 阅读全文
posted @ 2016-11-18 23:25 xiaoba1203 阅读(290) 评论(0) 推荐(0)
leetcode 152. Maximum Product Subarray --------- java
摘要:Find the contiguous subarray within an array (containing at least one number) which has the largest product. For example, given the array [2,3,-2,4],t 阅读全文
posted @ 2016-11-18 22:42 xiaoba1203 阅读(178) 评论(0) 推荐(0)
leetcode 151. Reverse Words in a String --------- java
摘要:Given an input string, reverse the string word by word. For example,Given s = "the sky is blue",return "blue is sky the". Update (2015-02-12):For C pr 阅读全文
posted @ 2016-11-18 21:49 xiaoba1203 阅读(267) 评论(0) 推荐(0)
 

上一页 1 2 3 4 5 6 7 ··· 9 下一页

公告


博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3