A. Odd | Even ?
Xotira: 32 MB, Vaqt: 1000 msGiven a list of integers, determine whether the sum of its elements is odd or even.
Give your answer as a string matching "odd"
or "even"
.
If the input array is empty consider it as: [0]
(array with a zero).
# | INPUT.TXT | OUTPUT.TXT |
---|---|---|
1 |
1 2 3 |
even |
B. Count the divisors of a number
Xotira: 32 MB, Vaqt: 1000 msCount the number of divisors of a positive integer n
.
Random tests go up to n = 50000
# | INPUT.TXT | OUTPUT.TXT |
---|---|---|
1 |
1 |
1 |
C. Replace With Alphabet Position
Xotira: 32 MB, Vaqt: 1000 ms"a" = 1
, "b" = 2
, etc.
Example
"The sunset sets at twelve o' clock."
Should return "20 8 5 19 21 14 19 5 20 19 5 20 19 1 20 20 23 5 12 22 5 15 3 12 15 3 11"
( as a string )
# | INPUT.TXT | OUTPUT.TXT |
---|---|---|
1 |
The sunset sets at twelve o' clock. |
20 8 5 19 21 14 19 5 20 19 5 20 19 1 20 20 23 5 12 22 5 15 3 12 15 3 11 |
D. Take a Number And Sum Its Digits Raised To The Consecutive Powers And ... Eureka!
Xotira: 32 MB, Vaqt: 1000 msThe number 8989 is the first integer with more than one digit that fulfills the property partially introduced in the title of this kata. What's the use of saying "Eureka"? Because this sum gives the same number: 89=81+9289=81+92
The next number in having this property is 135135:
See this property again: 135=11+32+53135=11+32+53
Task
We need a function to collect these numbers, that may receive two integers �a, �b that defines the range [�,�][a,b] (inclusive) and outputs a list of the sorted numbers in the range that fulfills the property described above.
Examples
Let's see some cases (input -> output):
1, 10 --> [1, 2, 3, 4, 5, 6, 7, 8, 9]
1, 100 --> [1, 2, 3, 4, 5, 6, 7, 8, 9, 89]
If there are no numbers of this kind in the range [�,�][a,b] the function should output an empty list.
90, 100 --> []
Enjoy it!!
# | INPUT.TXT | OUTPUT.TXT |
---|---|---|
1 |
90 150 |
135 |
E. Sum of angles
Xotira: 32 MB, Vaqt: 1000 msFind the total sum of internal angles (in degrees) in an n-sided simple polygon. N will be greater than 2.
YOU HAVE IQ
# | INPUT.TXT | OUTPUT.TXT |
---|
F. Search In rectangle
Xotira: 32 MB, Vaqt: 1000 msSizga to'rtburchakning a,b tomonlari beriladi
Yuzi va Perimetrini topib, kattasini chiqaring
INPUT.TXT
a,b butun sonlari
Natija
# | INPUT.TXT | OUTPUT.TXT |
---|---|---|
1 |
1 1 |
4 |
G. IQ #1
Xotira: 32 MB, Vaqt: 1000 msjavobga shu xabarni chiqaring
# | INPUT.TXT | OUTPUT.TXT |
---|