You have an array of logs. Each log is a space delimited string of words. For each log, the first word in each log is an alphanumeric identifier. Then, …
The Reduce in terms of Map-Reduce is often referring to reducing many values (vector) to a single value (scalar). In C++, the STL has a accumulate() method that allows …
Nowadays, you don’t have to implement your sorting algorithms e.g. quicksort, selection sort, insertion sort etc by yourself. Most programming languages provide the functions/library to do the sorting efficiently, …
Let’s say we want to implement a C++ function based on STL containers to check if a given string contains duplicate characters, or a given vector/array contains duplicate elements. …
Given a function f(x, y) and a value z, return all positive integer pairs x and y where f(x,y) == z. The function is constantly increasing, i.e.: f(x, y) …
In Javascript, the operator instanceof is used to perform a test to check if the prototype property of a constructor apperas in the chain of the object’s prototype chain. …