isNaN coerces its value to a number. (See MDN)
Because the string representation of an array is all of its items
concatenated with a comma. And the numerical representation of that is
NaN because of the comma.
But if there's only one item, hence no comma, it's able to be
converted to a number.
Maybe you can modify the formatter items using standard io
int n = 5; // or something else
fmt.modify_item(1, group(setw(n), setfill('0')));
With a given format, you can also add that inline:
std::cout << format("%u") % group(std::setw(n),
Live On Coliru
You need to select the country and count, then group by the country.
If you want to order it you need to add that on as well.
count(*) as numberOfSales
This query will have 2 columns in the results. The country names and
the number of times they appear according to the grouping. We are
Hint: Instead of 3 arguments, suppose your input is a non-empty list
of integers, i.e.
evenmin' :: [Int] -> Int
Suppose further you have a function phi that partitions the input like
phi [1, 2, 3, 4, 5, 6] == ([1,3,5],[2,4,6])
What would the definition of evenmin' be? Afterwards, define evenmin a
b c = evenmin' [a, b, c].
Let's reconsider the Bellman optimality equation for your task. I
consider this as a systematic approach to such problems (whereas I
often don't understand DP one-liners). My reference is the book of
Sutton and Barto.
The state in which your system is can be described by a triple of
integer numbers (i,j,r) (which is modeled as a
std::array<int,3>). Here, i and j denote column and row in you