Tuesday common C++ interview problem: Largest covered interval. Given an array of integers, return the size of the largest interval that is fully covered by the values in this array. Solve it yourself: https://lnkd.in/dtg6gFG4 Solution: https://lnkd.in/dUuxyprK #cpp #cplusplus #coding #programming #dailybiteofcpp
Hm....largest covered interval: does it mean an interval where we observe all numbers in increasing order without missed values?
Well, the high/low delta is 96 for sure. But doing a statistical analysis in QI Macros (dot plot, histogram) reveals two separate data sets. If you were a process or quality engineer, you might say you have two data sets that may be mixed. Certainly, we should question source of the data, how was it supplied or entered and is it valid? If you sort by color, the green group averages 3.5 and the 12 ends up with the other items over 90! Still looks like two groups of data from differing sources, but a 12 in the white coded data is an outlier. Data entry maybe, should it be a 92? Data is just data unless you question and analyze the sources!
96
Samsung Moscow Research Center•343 followers
2yAre you sure about linearity of your solution? Seems quadratic.