![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode题解
derek_大头
愿与诸君一起,天天向上
展开
-
leetcode412题解
leetcode 412.Fizz Buzz题解原创 2017-05-25 12:43:47 · 411 阅读 · 2 评论 -
leetcode387题解
leetcode 387. First Unique Character in a String题目Given a string, find the first non-repeating character in it and return it’s index. If it doesn’t exist, return -1. Examples:s = "leetcode"return 0.原创 2017-06-24 15:02:22 · 372 阅读 · 0 评论 -
leetcode13题解
leetcode 13. Roman to Integer题目Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999. 题目要求把罗马数字化为整数。解题思路首先要了解罗马数字的规则,见下图: 更多内容可以参考wiki了解了规则以后,我们再原创 2017-07-12 23:49:34 · 576 阅读 · 1 评论 -
leetcode217题解
leetcode 217. Contains Duplicate题目Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should原创 2017-07-12 21:59:54 · 367 阅读 · 2 评论 -
leetcode242题解
leetcode 242. Valid Anagram题目Given two strings s and t, write a function to determine if t is an anagram of s.For example, s = “anagram”, t = “nagaram”, return true. s = “rat”, t = “car”, return fals原创 2017-07-10 17:11:43 · 775 阅读 · 0 评论 -
leetcode237题解
leetcode 237. Delete Node in a Linked List题目Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.Supposed the linked list is 1 -> 2 -> 3 -> 4 and原创 2017-07-10 15:01:32 · 1426 阅读 · 1 评论 -
leetcode104题解
leetcode 104.Maximum Depth of Binary Tree题目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 leaf node.原创 2017-06-04 13:22:53 · 713 阅读 · 0 评论 -
leetcode136题解
leetcode 136.Single Number题目Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you imple原创 2017-06-02 20:25:47 · 403 阅读 · 0 评论 -
leetcode171题解
leetcode 171. Excel Sheet Column Number原创 2017-06-06 20:39:16 · 914 阅读 · 0 评论 -
leetcode122题解
leetcode 122. Best Time to Buy and Sell Stock II题目Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete原创 2017-06-05 18:18:50 · 1190 阅读 · 0 评论 -
leetcode283题解
leetcode 283.Move Zeroes题目Given an array nums, write a function to move all 0’s to the end of it while maintaining the relative order of the non-zero elements. For example, given nums = [0, 1, 0, 3, 1原创 2017-06-05 00:18:00 · 312 阅读 · 0 评论 -
leetcode371题解
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. 题目意思是:在不使用+和-运算的情况下,求两个整数的和。原创 2017-06-04 19:52:44 · 225 阅读 · 0 评论 -
leetcode344题解
leetcode344. Reverse String题目Write a function that takes a string as input and returns the string reversed.Example: Given s = “hello”, return “olleh”. 翻译成中文就是反转一个字符串,给的例子很好理解。解题思路这道题很简单,关键是时间复杂度和空间复杂原创 2017-05-28 21:44:22 · 306 阅读 · 0 评论 -
leetcode169题解
leetcode 169. Majority Element题目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 array is non-empty原创 2017-07-10 11:14:08 · 392 阅读 · 0 评论