Tag: c++
Given an integer n, return the nth (0-indexed) row of Pascal’s triangle. Pascal’s triangle can be created as follows: In the top row, there is an array of 1. …
Given a string, find the length of the longest substring T that contains at most k distinct characters. Example 1: Input: s = “eceba”, k = 2 Output: 3 …
Given a binary search tree root, and k return the kth (0-indexed) smallest value in root. It is guaranteed that the tree has at least k + 1 nodes. …
You are given a singly linked list node containing positive integers. Return the same linked list where every node’s next points to the node val nodes ahead. If there’s …
Given a singly linked list node, and an integer target, return the same linked list with all nodes whose value is target removed. Example 1 Input node = 0 …