You are given a string tiles containing uppercase English letters, where each letter represents a tile. You need to return the number of distinct non-empty sequences of letters that can be formed by selecting tiles from the string. A sequence can be formed by selecting tiles in any order and any number of times, but no tile can be used more than once in a sequence.
You are given the root of a binary tree and an integer limit. Your task is to delete all nodes in the tree that are considered insufficient. A node is insufficient if every root-to-leaf path passing through that node has a sum strictly less than the given limit. A leaf is defined as a node with no children. Return the root of the resulting binary tree after the deletions.
You are given a string s, and your task is to return the lexicographically smallest subsequence of s that contains all the distinct characters of s exactly once. The subsequence must be in the same order as the original string, but the characters should not repeat.
You are given two arrays, values and labels, representing the value and label of items, respectively. Your goal is to choose a subset of items with the maximum sum of values such that the number of items selected is at most numWanted and no label appears more than useLimit times in the subset. Return the maximum possible sum of the values from the selected subset of items.
Given an n x n binary matrix grid, find the shortest clear path in the matrix that connects the top-left cell (0, 0) to the bottom-right cell (n-1, n-1). A clear path is defined as a path where all cells along the path are 0, and the path can move in 8 possible directions (up, down, left, right, and diagonals). Return the length of the shortest clear path, or -1 if no such path exists.
You are given a dataset of integers in the range [0, 255], represented by an array count where count[k] denotes the frequency of number k in the dataset. From this dataset, compute the following statistics: minimum, maximum, mean, median, and mode.