|
|
back to boardThe answer is "N*(M+1)" yeah, it's mega simple problem... Yeah, it's simple but why my answer was wrong? anyone can help? Give me your code and I will help you Edited by author 31.01.2015 13:34 Edited by author 31.01.2015 13:34 why "N*(M+1)" i can't understand pls help "For each integer from 0 to M the function would calculate how many times this number appears in the N-element array..." Let's say N=2, so you have two-element array. Let's M=4, so you have to check whether there is any 0,1,2,3 or 4 (since from 0 to M) in each array... So total lines = 2*(4+1) Hope, it helped. how could 3 or 4 in the n? cause n = 2 so 3 or 4 are not in the array....for this reason why we don't use if else statement to see whether m is bigger than n or not...but we calculate it straightly?...can you please describe? because, a box is given as a clue ..... and you have to solve the problem according to that.. i guess :/ |
|
|