精彩
我係用reduce to (n-1)Cr 或者 d(1+x)^n呢兩個方法 無諗過你呢個方法
後面個insight更方便 number of comma=number of all word appearance - number of subset
We consider the sequence of numbers where a number is followed by the same number plus the sum of its digits. For example, 34 is followed by 41 (as 41=34+(3+4)) is itself followed by 46 (46 = 41 + (4+1)) The sequence would be 34 41 46 56 67 ....
Two sequences which start from different numbers may join at a given point, for example, the sequence starting from 471 and the sequence starting from 480 shares the number 519
Implement the function which takes the starting points of two sequences and then returns the joining point of these sequences.
The constraints given in the problem are the following:
The given sequences always join
0 < join point < 20000000
0 < s, s2 < 20000000
function computeJoinPoint(s1, s2) {
// do your things here
return {your answer}
}
function median(a,b,c){
return ________________;
}