GeetCode Hub

Jan 01, 0001 Easy

Two Sum

Two Sum

Given an array of integers nums&nbsp;and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution, and you may not use the <

read more...

Jan 01, 0001 Medium

Add Two Numbers

Add Two Numbers

You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two numbers and return the sum&nbsp;as a linked list. You may assume the two n

read more...

Jan 01, 0001 Medium

Longest Substring Without Repeating Characters

Longest Substring Without Repeating Characters

Given a string s, find the length of the longest substring without repeating characters. &nbsp; Example 1: Input: s = "abcabcbb" Output: 3 Explanation: The answer is "abc", wit

read more...

Jan 01, 0001 Hard

Median of Two Sorted Arrays

Median of Two Sorted Arrays

Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). &nbsp; Example 1

read more...

Jan 01, 0001 Medium

Longest Palindromic Substring

Longest Palindromic Substring

Given a string s, return&nbsp;the longest palindromic substring in s. &nbsp; Example 1: Input: s = "babad" Output: "bab" Note: "aba" is also a valid answer. <str

read more...

Jan 01, 0001 Medium

ZigZag Conversion

ZigZag Conversion

The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) P A H N A P L S I I G Y I R And then read line by line: "PAHNAPLSIIGYIR"</co

read more...

Jan 01, 0001 Easy

Reverse Integer

Reverse Integer

Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-231, 231 - 1], then return 0. Assume t

read more...

Jan 01, 0001 Medium

String to Integer (atoi)

String to Integer (atoi)

Implement the myAtoi(string s) function, which converts a string to a 32-bit signed integer (similar to C/C++'s atoi function). The algorithm for myAtoi(string s) is as follows: Read in and ignore any leading whitespace. Check if

read more...

Jan 01, 0001 Easy

Palindrome Number

Palindrome Number

Given an integer x, return true if x is palindrome integer. An integer is a palindrome when it reads the same backward as forward. For example, 121 is palindrome while 123 is not. &nbsp; <strong

read more...

Jan 01, 0001 Hard

Regular Expression Matching

Regular Expression Matching

Given an input string (s) and a pattern (p), implement regular expression matching with support for '.' and '*' where:&nbsp; '.' Matches any single character.​​​​ '*' Matches zero or m

read more...

Jan 01, 0001 Medium

Container With Most Water

Container With Most Water

Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of the line i is at <

read more...

Jan 01, 0001 Medium

Integer to Roman

Integer to Roman

Roman numerals are represented by seven different symbols:&nbsp;I, V, X, L, C, D and M. Symbol Value I 1 V 5 X 10 L

read more...