ab sum is exactly 10 more than either bc or ac sums, the result is 5.
Otherwise the result is 0.
Ko`kChipta
Sizda 3 ta butun a, b va c songa ega lotariya bor. Bular 3 ta ab, bc
va ac juftliklarni tashkil qiladi. Har bir juftlikning yig`indisini
hisoblang. Agar istalgan juftlikning qiymati aynan 10 ga teng
bo`lsa natija 10. Boshqa hollarda bc yoki ac juflik qiymatidan ab
yig`indi aynan 10 ga kata bo`lsa natija 5, qolgan barcha hollarda
natija 0
blueTicket(9, 1, 0) → 10
blueTicket(9, 2, 0) → 0
blueTicket(6, 1, 4) → 10
28.
shareDigit
Given two ints, each in the range 10..99, return true if there is a
digit that
appears
in both numbers, such as the 2 in 12 and 23. (Note: division, e.g.
n/10, gives the left digit while the % "mod" n%10 gives the right digit.)
Ikkita butun 10….99 oraliqda o`zgaruvchi butun son berilgan,
agar raqam har ikkala sonda bor bo`lsa true qiymat qaytaring.
Masalan, 2-> 12 va 23.
shareDigit(12, 23) → true
shareDigit(12, 43) → false
shareDigit(12, 44) → false
29.
sumLimit
Given 2
non-negative ints, a and b, return
their sum, so long as the sum
has the same number of digits as a. If the sum has more digits than a,
just return a without b. (Note: one way to compute the number
of digits of
a non-negative int n is to convert it to a string with String.valueOf(n) and
then check the length of the string.)
Dostları ilə paylaş: