Category: coding exercise
Given a BST (Binary Search Tree) with duplicates, find its mode(s) – the most frequently occurred element. A BST has the following characteristics: The left subtree of a node …
Given an array of integers – find out the maximum product of the tree numbers in the array. For example, output: and , output 24. We can easily write …
Given a string S and a character C, return an array of integers representing the shortest distance from the character C in the string. Example: Input: S = “loveleetcode”, …
Count the number of segments in a string, where a segment is defined to be a contiguous sequence of non-space characters. Please note that the string does not contain …
Given an array of string that is in the format of “count domain”, count the subdomain visits. For example, input the output is – could be in any order. …