![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetCode OJ
cag_are_god
哈哈哈
展开
-
leetcode 29. Divide Two Integers
题目:Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.public class Solution { public int divide(int dividend, int divisor) {原创 2017-04-24 17:27:04 · 280 阅读 · 0 评论 -
leetcode 371. Sum of Two Integers
题目:Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -.Example:Given a = 1 and b = 2, return 3.public class Solution { public int getSum(int原创 2017-04-24 15:29:44 · 256 阅读 · 0 评论 -
leetcode 113. Path Sum II
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tree and sum = 22, 5 / \原创 2017-04-14 11:17:35 · 198 阅读 · 0 评论 -
leetcode 1. Two Sum
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 solution, and you may not use the sam原创 2017-05-11 14:18:18 · 175 阅读 · 0 评论 -
leetcode 2. 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 i原创 2017-05-11 14:50:13 · 238 阅读 · 0 评论 -
leetcode 3. Longest Substring Without Repeating Characters
题目:Given a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb", the answer is "abc", which the length is 3.Given "bbbbb", the an原创 2017-05-13 09:57:59 · 234 阅读 · 0 评论 -
leetcode 4. Median of Two Sorted Arrays
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+n)).Example 1:nums1 =原创 2017-05-13 10:46:31 · 308 阅读 · 0 评论 -
杭电oj(Java版)2602 Bone Collector 01背包问题
Bone CollectorTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 60730 Accepted Submission(s): 25315Problem DescriptionMany year原创 2017-05-14 09:39:21 · 548 阅读 · 0 评论 -
leetcode 28. Implement strStr()
问题:Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.采用KMP模式匹配算法:主要参考 http://blog.csdn.net/v_july_v/article/deta原创 2017-05-19 19:21:14 · 356 阅读 · 0 评论