原创 Roman to Integertegerer

問題描述:Roman to Integer Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range f

原创 Maximum Depth of Binary Tree

問題描述:Maximum Depth of Binary Tree Given a binary tree, find its maximum depth. The maximum depth is the number of node

原创 Longest Common Prefix

問題描述:Longest Common Prefix Write a function to find the longest common prefix string amongst an array of strings. 思路:

原创 Add Two Numbers

問題描述:Add Two Numbers You are given two non-empty linked lists representing two non-negative integers. The digits are s

原创 Remove Duplicates from Sorted Array

問題描述:Remove Duplicates from Sorted Array Given a sorted array, remove the duplicates in place such that each elemen

原创 Single NumbererⅡ

題目描述:Single NumbererⅡ Given an array of integers, every element appears three times except for one, which appears

原创 Single NumbererⅢ

題目描述:Single NumbererⅢ Given an array of numbers nums, in which exactly two elements appear only once and all the ot

原创 Find the Difference

問題描述:Find the Difference Given two strings s and t which consist of only lowercase letters. String t is generated by r

原创 Longest Substring Without Repeating Characters

問題描述:Longest Substring Without Repeating Characters Given a string, find the length of the longest substring without r

原创 Ugly Number

題目描述:Ugly Number Write a program to check whether a given number is an ugly number. Ugly numbers are positive numbers

原创 Ugly Number II

問題描述:Ugly Number II Write a program to find the n-th ugly number. Ugly numbers are positive numbers whose prime factor

原创 Container With Most Water

Container With Most Water 問題描述: Given n non-negative integers a1, a2, …, an, where each represents a point at coord

原创 Single Number

問題描述:Single Number Given an array of integers, every element appears twice except for one. Find that single one. No

原创 Palindrome Number

Palindrome Number 問題描述: Determine whether an integer is a palindrome. Do this without extra space. 思路:這個問題需要注意的第一個問題是

原创 吝嗇SAT問題

問題描述: 吝嗇SAT問題是這樣的:給定一組子句(每個子句都是其中文字的析取)和整數k,求一個最多有k個變量爲true的滿足賦值——如果該賦值存在。證明吝嗇問題是NP-完全問題。 爲了幫助理解這個問題,我們寫解釋下什麼是SAT問題