Skip to main content

34 docs tagged with "Linkedln"

View All Tags

Accounts Merge

Given a list of accounts where each element accounts[i] is a list of strings, where the first element accounts[i][0] is a name, and the rest of the elements are emails representing emails of the account.

Binary Tree Zigzag Level Order Traversal

Given the root of a binary tree, return the zigzag level order traversal of its nodes' values. (i.e., from left to right, then right to left for the next level and alternate between).

Daily Temperatures

Given an array of integers temperatures represents the daily temperatures, return an array answer such that answer[i] is the number of days you have to wait after the ith day to get a warmer temperature.

Find Median from Data Stream

The median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value, and the median is the mean of the two middle values.

Find Smallest Letter Greater Than Target

Return the smallest character in letters that is lexicographically greater than target. If such a character does not exist, return the first character in letters.

Insert Interval

You are given an array of non-overlapping intervals intervals where intervals[i] = [starti, endi] represent the start and the end of the ith interval and intervals is sorted in ascending order by starti.

K Closest Points to Origin

Given an array of points where points[i] = [xi, yi] represents a point on the X-Y plane and an integer k, return the k closest points to the origin (0, 0).

LRU Cache

Design a data structure that follows the constraints of a Least Recently Used (LRU) cache.

Maximum Product Subarray

Given an integer array nums, find a subarray that has the largest product, and return the product.

Maximum Subarray

Given an integer array nums, find the subarray which has the largest sum and return its sum.

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.

Merge Intervals

Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals...

Min Stack

Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.

Minimum Window Substring

Given two strings s and t of lengths m and n respectively, return the minimum window substring of s such that every character in t (including duplicates) is included in the window.

Number of Islands

Given an m x n 2D binary grid grid which represents a map of '1's (land) and '0's (water), return the number of islands.

Partition to K Equal Sum Subsets

Given an integer array nums and an integer k, return true if it is possible to divide this array into k non-empty subsets whose sums are all equal.

Permutations

Given an array nums of distinct integers, return all the possible permutations. You can return the answer in any order.

Pow(x, n)

Implement pow(x, n), which calculates x raised to the power n.

Random Pick with Weight

You need to implement the function pickIndex(), which randomly picks an index in the range [0, w.length - 1] (inclusive) and returns it.

Rotate List

Given the head of a linked list, rotate the list to the right by k places.

Same Tree

Given the roots of two binary trees p and q, write a function to check if they are the same or not.

Search in Rotated Sorted Array

Given the array nums after the possible rotation and an integer target, return the index of target if it is in nums, or -1 if it is not in nums.

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).

Subarray Sum Equals K

Given an array of integers nums and an integer k, return the total number of subarrays whose sum equals to k.

Valid Parentheses

Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.