A. Find the odd int

Xotira: 32 MB, Vaqt: 1000 ms
Masala

Given an array of integers, find the one that appears an odd number of times.

There will always be only one integer that appears an odd number of times.

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

B. Find the stray number

Xotira: 32 MB, Vaqt: 1000 ms
Masala

You are given an odd-length array of integers, in which all of them are the same, except for one single number.

Complete the method which accepts such an array, and returns that single different number.

The input array will always be valid! (odd-length >= 3)

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

C. Form The Minimum

Xotira: 32 MB, Vaqt: 1000 ms
Masala

Task

Given a list of digits, return the smallest number that could be formed from these digits, using the digits only once (ignore duplicates).

Kiruvchi ma'lumotlar:
Chiquvchi ma'lumotlar:
Misollar:
# INPUT.TXT OUTPUT.TXT
1
1 3 1
13

D. You`re a square!

Xotira: 32 MB, Vaqt: 1000 ms
Masala

A square of squares

You like building blocks. You especially like building blocks that are squares. And what you even like more, is to arrange them into a square of square building blocks!

However, sometimes, you can't arrange them into a square. Instead, you end up with an ordinary rectangle! Those blasted things! If you just had a way to know, whether you're currently working in vain… Wait! That's it! You just have to check if your number of building blocks is a perfect square.

Task

Given an integral number, determine if it's a square number:

In mathematics, a square number or perfect square is an integer that is the square of an integer; in other words, it is the product of some integer with itself.

The tests will always use some integral number, so don't worry about that in dynamic typed languages.


 

Kiruvchi ma'lumotlar:
Chiquvchi ma'lumotlar:
Misollar:
# INPUT.TXT OUTPUT.TXT
1
-1
false
2
0
true

E. Find the missing letter

Xotira: 32 MB, Vaqt: 1000 ms
Masala

Write a method that takes an array of consecutive (increasing) letters as input and that returns the missing letter in the array.

You will always get an valid array. And it will be always exactly one letter be missing. The length of the array will always be at least 2.
The array will always contain letters in only one case.

Kiruvchi ma'lumotlar:
Chiquvchi ma'lumotlar:
Misollar:
# INPUT.TXT OUTPUT.TXT
1
a b c d f
e

F. Complementary DNA

Xotira: 32 MB, Vaqt: 1000 ms
Masala

Deoxyribonucleic acid (DNA) is a chemical found in the nucleus of cells and carries the "instructions" for the development and functioning of living organisms.

If you want to know more: http://en.wikipedia.org/wiki/DNA

In DNA strings, symbols "A" and "T" are complements of each other, as "C" and "G". Your function receives one side of the DNA (string, except for Haskell); you need to return the other complementary side. DNA strand is never empty or there is no DNA at all (again, except for Haskell).

More similar exercise are found here: http://rosalind.info/problems/list-view/ (source)

Kiruvchi ma'lumotlar:
Chiquvchi ma'lumotlar:
Misollar:
# INPUT.TXT OUTPUT.TXT
1
GTAT
CATA
Kitob yaratilingan sana: 16-Feb-25 16:49