Question:

Given a string S, find the length of the longest substring T that contains at most two distinct characters.

g0d2 發表在 痞客邦 留言(0) 人氣()

Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. For "bbbbb" the longest substring is "b", with the length of 1.


class Solution(object):

g0d2 發表在 痞客邦 留言(0) 人氣()

Implement atoi to convert a string to an integer.

Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input cases.

g0d2 發表在 痞客邦 留言(0) 人氣()

Question:

Similar to Question [6. Reverse Words in a String], but with the following constraints:

g0d2 發表在 痞客邦 留言(0) 人氣()

Given an input string, reverse the string word by word.

For example,
Given s = "the sky is blue",
return "blue is sky the".

g0d2 發表在 痞客邦 留言(0) 人氣()

Implement strStr().

Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.

g0d2 發表在 痞客邦 留言(0) 人氣()

Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.

For example,
"A man, a plan, a canal: Panama" is a palindrome.
"race a car" is not a palindrome.

g0d2 發表在 痞客邦 留言(0) 人氣()

Question:

Similar to Question [1. Two Sum], except that the input array is already sorted in ascending order.

g0d2 發表在 痞客邦 留言(0) 人氣()

#Question 1 - Primes
# Write a function to determine whether a given number is prime or not (divisible only by itself and 1). Use the Wikipedia definition of a prime number (https://en.wikipedia.org/wiki/Prime_number) as a reference.

文章標籤

g0d2 發表在 痞客邦 留言(0) 人氣()

https://leetcode.com/problems/two-sum/

Given an array of integers, find two numbers such that they add up to a specific target number.

g0d2 發表在 痞客邦 留言(0) 人氣()

«123