/bb-subarrays

Bloomberg Subarrays

Primary LanguageC++

bb-subarrays

Compile with:

g++ -std=c++14 -Irange-v3/include main.cpp

Example input/output:

We're going to create k sorted arrays each containing n integers 
between 1 and 100 (inclusive)

k = 5
n = 5

in[0] = [ 19,  33,  38,  52, 100]
in[1] = [  1,  29,  77,  85, 100]
in[2] = [  5,   6,  60,  71,  74]
in[3] = [ 46,  60,  64,  73,  80]
in[4] = [ 10,  54,  56,  79,  89]

out[] = [1, 5, 6, 10, 19, 29, 33, 38, 46, 52, 54, 56, 60, 60, 64, 71, 73, 74, 77, 79, 80, 85, 89, 100, 100]