随笔分类 - Python
摘要:Problem Definition:Given an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.Solution:要求把所有存在an...
阅读全文
摘要:Problem Definition:Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily lar...
阅读全文
摘要:Problem Definition:Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.Solution:就是要用加减和位操作之类...
阅读全文
摘要:1)a是引用,指向(标注)一段连续的内存区域,内容是 1,2 b是引用,指向一段连续的内存区域,内容是另一个引用。后者指向当时a所指向的东西,也就是那块内容为1,2的内存区域。 a被重定向,指向另一个内存区域,内容是4,52)a是引用,指向(标注)一段连续的内存区域,内容是 1,2 b是引用,指向...
阅读全文
摘要:Problem Definition:Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just l...
阅读全文
摘要:Problem Definition:Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the strin...
阅读全文
摘要:Problem Definition:Given two binary strings, return their sum (also a binary string). For example,a = "11"b = "1"Return "100".Solution: crack it in a ...
阅读全文
摘要:Problem Definiton:Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note:You may assume that nums1 has enou...
阅读全文
摘要:Problem Definition:Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example,"A man, a...
阅读全文
摘要:Problem Definition: Compare two version numbers version1 and version2. If version1 > version2 return 1, if version1 f2 else (-1 if f1b a=[1] b=[0,2...
阅读全文
摘要:Problem Definition: Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. Y...
阅读全文
摘要:Problem Definition: Given a column title as appear in an Excel sheet, return its corresponding column number. For example: A -> 1 B -> 2 C ->...
阅读全文
摘要:Problem Definition:Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as 0000001010010100000111...
阅读全文
摘要:Problem Definition:Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight).For ex...
阅读全文
摘要:Problem Definition: Given an array of integers and an integer k, find out whether there there are two distinct indices i and j in the array such tha...
阅读全文
摘要:Problem Definition: Given a sorted integer array without duplicates, return the summary of its ranges. For example, given [0,1,2,4,5,7], return ["0-...
阅读全文
摘要:here
阅读全文
摘要:Closures In PythonEntirely copied from here All I want is to mark it, thanks for this nice article.You might have lived a long and happy coding life w...
阅读全文

浙公网安备 33010602011771号