A. Convert boolean values to strings 'Yes' or 'No'.

Xotira: 32 MB, Vaqt: 1000 ms
Masala

Complete the method that takes a boolean value and return a "Yes" string for true, or a "No" string for false.

Kiruvchi ma'lumotlar:
Chiquvchi ma'lumotlar:
Misollar:
# INPUT.TXT OUTPUT.TXT
1
true
Yes

B. Convert number to reversed array of digits

Xotira: 32 MB, Vaqt: 1000 ms
Masala

Given a random non-negative number, you have to return the digits of this number within an array in reverse order.

Example(Input => Output):

35231 => [1,3,2,5,3]
0 => [0]
Kiruvchi ma'lumotlar:
Chiquvchi ma'lumotlar:
Misollar:
# INPUT.TXT OUTPUT.TXT
1
348597
[7,9,5,8,4,3]

C. Is he gonna survive?

Xotira: 32 MB, Vaqt: 1000 ms
Masala

A hero is on his way to the castle to complete his mission. However, he's been told that the castle is surrounded with a couple of powerful dragons! each dragon takes 2 bullets to be defeated, our hero has no idea how many bullets he should carry.. Assuming he's gonna grab a specific given number of bullets and move forward to fight another specific given number of dragons, will he survive?

Return true if yes, false otherwise :)

Kiruvchi ma'lumotlar:
Chiquvchi ma'lumotlar:
Misollar:
# INPUT.TXT OUTPUT.TXT
1
10 5
true
2
7 4
false

D. Is the string uppercase?

Xotira: 32 MB, Vaqt: 1000 ms
Masala

Create a method to see whether the string is ALL CAPS.

Kiruvchi ma'lumotlar:
Chiquvchi ma'lumotlar:
Misollar:
# INPUT.TXT OUTPUT.TXT
1
c
false
2
C
true
Kitob yaratilingan sana: 24-Nov-24 03:38