Category: c / c++
A string S represents a list of words. Each letter in the word has 1 or more options. If there is one option, the letter is represented as is. …
Given an array A of positive integers, let S be the sum of the digits of the minimal element of A. Return 0 if S is odd, otherwise return …
Given an array of characters, compress it in-place. The length after compression must always be smaller than or equal to the original array. Every element of the array should …
Numbers can be regarded as product of its factors. For example, 8 = 2 x 2 x 2; = 2 x 4. Write a function that takes an integer …
Design a hit counter which counts the number of hits received in the past 5 minutes. Each function accepts a timestamp parameter (in seconds granularity) and you may assume …