![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode算法题
leonfree777
不忘初心,方得始终!
展开
-
【跟Leon一起刷LeetCode】461. Hamming Distance
Hamming Distance Description: The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integersx and y, calculate the Hamming原创 2018-01-16 09:56:37 · 153 阅读 · 0 评论 -
【跟Leon一起刷LeetCode】566. Reshape the Matrix
Reshape the Matrix Description: In MATLAB, there is a very useful function called ‘reshape’, which can reshape a matrix into a new one with different size but keep its original data. You’re given a原创 2018-01-20 17:14:35 · 137 阅读 · 0 评论 -
【跟Leon一起刷LeetCode】669. Trim a Binary Search Tree
Trim a Binary Search Tree Description: Given a binary search tree and the lowest and highest boundaries as L and R, trim the tree so that all its elements lies in [L, R] (R >= L). You might need to原创 2018-01-20 16:59:28 · 181 阅读 · 0 评论 -
【跟Leon一起刷LeetCode】412. Fizz Buzz
Fizz Buzz Description: Write a program that outputs the string representation of numbers from 1 to n. But for multiples of three it should output “Fizz” instead of the number and for the multiples原创 2018-01-20 16:45:22 · 156 阅读 · 0 评论 -
【跟Leon一起刷LeetCode】620. Not Boring Movies
Not Boring Movies Description: X city opened a new cinema, many people would like to go to this cinema. The cinema also gives out a poster indicating the movies’ ratings and descriptions. Please wr原创 2018-01-20 16:37:27 · 266 阅读 · 0 评论 -
【跟Leon一起刷LeetCode】344. Reverse String
Reverse String Description: Write a function that takes a string as input and returns the string reversed. Example 1: Given s = "hello", return "olleh". 问题描述: 如题,反转一个字符串中每个字符串的顺序。 Sol原创 2018-01-20 16:15:52 · 121 阅读 · 0 评论 -
【跟Leon一起刷LeetCode】500. Keyboard Row
Keyboard Row Description: Given a List of words, return the words that can be typed using letters of alphabet on only one row’s of American keyboard like the image below. Example 1: Input:原创 2018-01-20 16:25:53 · 149 阅读 · 0 评论 -
【跟Leon一起刷LeetCode】557. Reverse Words in a String III
Reverse Words in a String III Description: Given a string, you need to reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order. Examp原创 2018-01-20 16:10:40 · 199 阅读 · 0 评论 -
【跟Leon一起刷LeetCode】476. Number Complement
Number ComplementDescription:Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation.Example 1:Input: 5 Output: 2 Explanation: T原创 2018-01-19 16:02:12 · 137 阅读 · 0 评论 -
【跟Leon一起刷LeetCode】561. Array Partition I
Array Partition I Description: Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), …, (an, bn) which makes sum of min(ai, bi) for all原创 2018-01-16 17:32:50 · 130 阅读 · 0 评论 -
【跟Leon一起刷LeetCode】627. Swap Salary
Swap Salary Description: Given a table salary, such as the one below, that has m=male and f=female values. Swap all f and m values (i.e., change all f values to m and vice versa) with a single upd原创 2018-01-16 17:18:57 · 285 阅读 · 0 评论 -
【跟Leon一起刷LeetCode】728. Self Dividing Numbers
Self Dividing Numbers Description: A self-dividing number is a number that is divisible by every digit it contains. For example, 128 is a self-dividing number because 128 % 1 == 0, 128 % 2 == 0, an原创 2018-01-16 11:22:58 · 136 阅读 · 0 评论 -
【跟Leon一起刷LeetCode】617. Merge Two Binary Trees
Merge Two Binary Trees Description: Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not. You nee原创 2018-01-16 10:27:38 · 136 阅读 · 0 评论 -
【跟Leon一起刷LeetCode】657. Judge Route Circle
Judge Route Circle Description: Initially, there is a Robot at position (0, 0). Given a sequence of its moves, judge if this robot makes a circle, which means it moves back to the original place. T原创 2018-01-16 10:12:29 · 178 阅读 · 0 评论 -
【跟Leon一起刷LeetCode】595. Big Countries
Big Countries Description: There is a table World +-----------------+------------+------------+--------------+---------------+ | name | continent | area | population | gdp原创 2018-01-16 09:37:11 · 197 阅读 · 0 评论 -
【跟Leon一起刷LeetCode】463. Island Perimeter
Island Perimeter Description: You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/vertically (not diag原创 2018-01-20 17:35:16 · 159 阅读 · 0 评论