1522.Diameter of N-Ary Tree

Problem description:

Given a root of an N-ary tree, you need to compute the length of the diameter of the tree.

Readmore

515.Find Largest Value in Each Tree Row

Problem description:

Given the root of a binary tree, return an array of the largest value in each row of the tree (0-indexed).

Readmore

362.Design Hit Counter

Problem description:

Design a hit counter which counts the number of hits received in the past 5 minutes (i.e., the past 300 seconds).

Readmore

1868.Product of Two Run-Length Encoded Arrays

Problem description:

Run-length encoding is a compression algorithm that allows for an integer array nums with many segments of consecutive repeated numbers to be represented by a (generally smaller) 2D array encoded. Each encoded[i] = [vali, freqi] describes the ith segment of repeated numbers in nums where vali is the value that is repeated freqi times.

Readmore

921.Minimum Add to Make Parentheses Valid

Problem description:

A parentheses string is valid if and only if:

Readmore

1539.Kth Missing Positive Number

Problem description:

Given an array arr of positive integers sorted in a strictly increasing order, and an integer k.

Readmore

1209.Remove All Adjacent Duplicates in String II

Problem description:

You are given a string s and an integer k, a k duplicate removal consists of choosing k adjacent and equal letters from s and removing them, causing the left and the right side of the deleted substring to concatenate together.

Readmore

1004.Max Consecutive Ones III

Problem description:

Given a binary array nums and an integer k, return the maximum number of consecutive 1‘s in the array if you can flip at most k 0‘s.

Readmore

983.Minimum Cost For Tickets

Problem description:

You have planned some train traveling one year in advance. The days of the year in which you will travel are given as an integer array days. Each day is an integer from 1 to 365.

Readmore

658.Find K Closest Elements

Problem description:

Given a sorted integer array arr, two integers k and x, return the k closest integers to x in the array. The result should also be sorted in ascending order.

Readmore