Rotate Image

You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise)

Restore IP Addresses

Given a string containing only digits, restore it by returning all possible valid IP address combinations. Order of the result does not matter.

Pow(x, n)

Implement pow(x, n).

Clone Binary Tree

Given a binary tree, return a deep copy of it.

Longest Common Subsequence

Given two strings, find the length of the longest common subsequence (LCS).

Implement Trie

Implement a trie with insert, search, and startsWith methods.

Gray Code

The gray code is a binary numeral system where two successive values differ in only one bit.

Integer to Roman

Given a roman numeral, convert it to an integer.

Integer to Roman

Given an integer, in the range of 1 to 3999, convert it to a Roman numeral.

Find Peak Element

Given an integer array A, a peak element with index p is defined as A[p] > A[p - 1] && A[p] > A[p + 1]. Find a peak element in this array and return its index. The array may contains multiple peeks; return any of them.