Leetcode - python
文章平均质量分 64
Python 实现leetcode上面的题目
cheney康
中山大学计算机学院研究生
展开
-
【Leetcode】806. Number of Lines To Write String
806. Number of Lines To Write StringWe are to write the letters of a given string S, from left to right into lines. Each line has maximum width 100 units, and if writing a letter would cause the width...原创 2018-03-28 19:39:16 · 379 阅读 · 0 评论 -
【Leetcode】804. Unique Morse Code Words
804. Unique Morse Code Wordshttps://leetcode.com/problems/unique-morse-code-words/description/International Morse Code defines a standard encoding where each letter is mapped to a series of dots and d...原创 2018-03-27 00:12:53 · 1030 阅读 · 0 评论 -
【Leetcode】771. Jewels and Stones
771. Jewels and StonesYou're given strings J representing the types of stones that are jewels, and S representing the stones you have. Each character in S is a type of stone you have. You want to kn...原创 2018-03-27 19:49:53 · 227 阅读 · 0 评论 -
【Leetcode】617. Merge Two Binary Trees
617. Merge Two Binary TreesGiven 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 need to merge th...原创 2018-03-28 22:39:28 · 182 阅读 · 0 评论 -
【Leetcode】461. Hamming Distance
461. Hamming Distancehttps://leetcode.com/problems/hamming-distance/description/The Hamming distance between two integers is the number of positions at which the corresponding bits are different.Given...原创 2018-03-27 23:45:26 · 233 阅读 · 0 评论 -
【Leetcode】83. Remove Duplicates from Sorted List
leecode 地址:https://leetcode.com/problems/remove-duplicates-from-sorted-list/description/Given a sorted linked list, delete all duplicates such that each element appear only once.For example,Given 1-&g...原创 2018-03-25 23:05:41 · 176 阅读 · 0 评论 -
【Leetcode】1. Two sum
Two sum class Solution: def twoSum(self, nums, target): dict={} for i in range(len(nums)): if target -nums[i] in dict: return [dict[target -nums[i]],i] ...原创 2018-02-10 16:56:29 · 220 阅读 · 0 评论