Software programing
Kanalga Telegram’da o‘tish
This is a channel which gives tutorial on different programming languages, android tips and tricks best apps etc...
Ko'proq ko'rsatish1 471
Obunachilar
Ma'lumot yo'q24 soatlar
Ma'lumot yo'q7 kun
Ma'lumot yo'q30 kun
Postlar arxiv
1 471
JS answer:
function meeting(s) {
let string = s.toUpperCase().split(';').map(x => x.split(':').reverse().join(', ')).sort().join(')(')
return '(' + string + ')'
}
const meeting = (s) => s.toUpperCase().split(';').map(name => name.split(':').reverse()).sort().map(name =>
(${name.join(', ')})).join('') and more...1 471
John has invited some friends. His list is:
s = "Fred:Corwill;Wilfred:Corwill;Barney:Tornbull;Betty:Tornbull;Bjon:Tornbull;Raphael:Corwill;Alfred:Corwill";
Could you make a program that
makes this string uppercase
gives it sorted in alphabetical order by last name.
When the last names are the same, sort them by first name. Last name and first name of a guest come in the result between parentheses separated by a comma.
So the result of function meeting(s) will be:
"(CORWILL, ALFRED)(CORWILL, FRED)(CORWILL, RAPHAEL)(CORWILL, WILFRED)(TORNBULL, BARNEY)(TORNBULL, BETTY)(TORNBULL, BJON)"
It can happen that in two distinct families with the same family name two people have the same first name too.
1 471
given a string, replace every letter with its position in the alphabet.
If anything in the text isn't a letter, ignore it and don't return it.
"a" = 1, "b" = 2, etc.
Example
alphabetPosition("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)
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
another example:
"The narwhal bacons at midnight." =
"20 8 5 14 1 18 23 8 1 12 2 1 3 15 14 19 1 20 13 9 4 14 9 7 8 20"
1 471
You have an array of numbers.
Your task is to sort ascending odd numbers but even numbers must be on their places.
Zero isn't an odd number and you don't need to move it. If you have an empty array, you need to return it.
Example
5, 3, 2, 8, 1, 4 will be 1, 3, 2, 8, 5, 4
5, 3, 1, 8, 0 will be 1, 3, 5, 8, 0
gdluck...
1 471
Given an array try to find and return all odd numbers
let's say you have
20,1,-1,2,-2,3,3,5,5,1,2,4,20,4,-1,-2,5
The Answer would be:
1, 3, 3, 5, 5
