962. Maximum Width Ramp

Problem description:

Given an array A of integers, a ramp is a tuple (i, j) for which i < j and A[i] <= A[j]. The width of such a ramp is j - i.

Readmore

19. Remove Nth Node From End of List

Problem description:

Given a linked list, remove the n-th node from the end of list and return its head.

Readmore

929. Unique Email Addresses

Problem description:

Every email consists of a local name and a domain name, separated by the @ sign.

Readmore

958. Check Completeness of a Binary Tree

Problem description:

Given a binary tree, determine if it is a complete binary tree.

Readmore

322. Coin Change

Problem description:

You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you need to make up that amount. If that amount of money cannot be made up by any combination of the coins, return -1.

Readmore

675. Cut Off Trees for Golf Event

Problem description:

You are asked to cut off trees in a forest for a golf event. The forest is represented as a non-negative 2D map, in this map:

Readmore

C++ object-oriented

  • Object
    This is the basic unit of object-oriented programming. That is both data and function that operate on data are bundled as a unit called as object.

Readmore

14. Longest Common Prefix

Problem description:

Write a function to find the longest common prefix string amongst an array of strings.

Readmore

11. Container With Most Water

Problem description:

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 line i is at (i, ai) and (i, 0). Find two lines, which together with x-axis forms a container, such that the container contains the most water.

Readmore

7. Reverse Integer

Problem description:

Given a 32-bit signed integer, reverse digits of an integer.

Readmore