Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
yuh
There is no need for the
break
statement in your code, since thereturn
statement exits the whole function (and thus exits theswitch
statement as well)The "abs(mPos - cPos)" is a no-op since unsigned values likes size_t can't go negative.
omg göttlich
ever reached break here?
I don’t think we need to judge to divide by 0. When an incorrect parameter is entered, an error message should be displayed, prompting the inputter that the parameter is incorrect. Otherwise, people who use the function will think that 0 is also a valid divisor. Unless the requirements clearly indicate the need for compatibility with a divisor of 0. :)
Arent you looping over the field variable 3 times when you are finding each of c, m and d?
This type of metaprogramming is definitely more difficult than 4Kyu.
lack of divide by 0
no break; needed return breaks automatically
That regex will only work if you actually have two digits each. So something like 9:01:01 would fail.
This comment is hidden because it contains spoiler information about the solution
push_back
isO(1)
, but creating ann
xn
matrix will always beO(n^2)
.And there's no point in
e
when you can write1
s directly to the matrix.Is the
push_back
an O(n) operation? If it is then I guess this is still O(n^2).Loading more items...