Question:
Given a string S, find the length of the longest substring T that contains at most two distinct characters.
Question:
Given a string S, find the length of the longest substring T that contains at most two distinct characters.
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):
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.
Question:
Similar to Question [6. Reverse Words in a String], but with the following constraints:
Given an input string, reverse the string word by word.
For example,
Given s = "the sky is blue
",
return "blue is sky the
".
Implement strStr().
Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.
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.
Question:
Similar to Question [1. Two Sum], except that the input array is already sorted in ascending order.
#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.
https://leetcode.com/problems/two-sum/
Given an array of integers, find two numbers such that they add up to a specific target number.