317. Shortest Distance from All Buildings

Problem description:

You are given an m x n grid grid of values 0, 1, or 2, where:

Readmore

1344. Angle Between Hands of a Clock

Problem description:

Given two numbers, hour and minutes. Return the smaller angle (in degrees) formed between the hour and the minute hand.

Readmore

670. Maximum Swap

Problem description:

You are given an integer num. You can swap two digits at most once to get the maximum valued number.

Readmore

282. Expression Add Operators

Problem description:

Given a string num that contains only digits and an integer target, return all possibilities to add the binary operators '+', '-', or '*' between the digits of num so that the resultant expression evaluates to the target value.

Readmore

556. Next Greater Element III

Problem description:

Given a positive integer n, find the smallest integer which has exactly the same digits existing in the integer n and is greater in value than n. If no such positive integer exists, return -1.

Readmore

503. Next Greater Element II

Problem description:

Given a circular integer array nums (i.e., the next element of nums[nums.length - 1] is nums[0]), return the next greater number for every element in nums.

Readmore

496. Next Greater Element I

Problem description:

The next greater element of some element x in an array is the first greater element that is to the right of x in the same array.

Readmore

708. Insert into a Sorted Circular Linked List

Problem description:

Given a Circular Linked List node, which is sorted in ascending order, write a function to insert a value insertVal into the list such that it remains a sorted circular list. The given node can be a reference to any single node in the list and may not necessarily be the smallest value in the circular list.

Readmore

151. Reverse Words in a String

Problem description:

Given an input string s, reverse the order of the words.

Readmore

1213. Intersection of Three Sorted Arrays

Problem description:

Solution:

time complexity: $O()$
space complexity: $O()$
reference:
related problem:

Readmore