Write a function called repeatStr which repeats the given string string exactly n times.repeatStr(6, "I") // "IIIIII"repeatStr(5, "Hello") // "HelloHe
Create a function that takes an integer as an argument and returns "Even" for even numbers or "Odd" for odd numbers.
In this simple assignment you are given a number and have to make it negative. But maybe the number is already negative?Example:makeNegative(1); // re
You get an array of numbers, return the sum of all of the positives ones.Example 1,-4,7,12 => 1 + 7 + 12 = 20Note: if there is nothing to sum, the sum
Write a program that finds the summation of every number from 1 to num. The number will always be a positive integer greater than 0.For example:summat
Complete the method that takes a boolean value and return a "Yes" string for true, or a "No" string for false.
Given an array of integers your solution should find the smallest integer.For example:Given 34, 15, 88, 2 your solution will return 2Given 34, -345, -
It's pretty straightforward. Your goal is to create a function that removes the first and last characters of a string. You're given one parameter, the
Complete the square sum function so that it squares each number passed into it and then sums the results together.For example, for 1, 2, 2 it should r
Consider an array/list of sheep where some sheep may be missing from their place. We need a function that counts the number of sheep present in the ar
Description:The first century spans from the year 1 up to and including the year 100, The second - from the year 101 up to and including the year 200,
Description:Nathan loves cycling.Because Nathan knows it is important to stay hydrated, he drinks 0.5 litres of water per hour of cycling.You get give
Description:Create a function that checks if a number n is divisible by two numbers x AND y. All inputs are positive, non-zero digits.Examples:1) n =
Description:Given an array of integers.Return an array, where the first element is the count of positives numbers and the second element is sum of neg
Description:Given an array of integers, return a new array with each value doubled.For example:1, 2, 3 --> 2, 4, 6
Description:Return the number (count) of vowels in the given string.We will consider a, e, i, o, u as vowels for this Kata (but not y).The input strin
Description:Given a set of numbers, return the additive inverse of each. Each positive becomes negatives, and the negatives become positives.invert(1,
Description:It's the academic year's end, fateful moment of your school report. The averages must be calculated. All the students come to you and entr
DescriptionWe need a function that can transform a string into a number. What ways of achieving this do you know?Note: Don't worry, all inputs will be
Description:Clock shows h hours, m minutes and s seconds after midnight.Your task is to write a function which returns the time since midnight in mill
Given a string of digits, you should replace any digit below 5 with '0' and any digit 5 and above with '1'. Return the resulting string.
Sum all the numbers of the array (in F(The highest/lowest element is respectively only one element at each edge, even if there are more than one with
Our football team finished the championship. The result of each match look like "x:y". Results of all matches are recorded in the collection.For examp
Write a function which calculates the average of the numbers in a given list.Note: Empty arrays should return 0.
Build a function that returns an array of integers from n to 1 where n>0.Example : n=5 --> 5,4,3,2,1
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! e
I'm new to coding and now I want to get the sum of two arrays...actually the sum of all their elements. I'll appreciate for your help.P.S. Each array
Write function bmi that calculates body mass index (bmi = weight / height2).if bmi <= 18.5 return "Underweight"if bmi <= 25.0 return "Normal"if
Implement a function which convert the given boolean value into its string representation.Note: Only valid inputs will be given.
Your task is to find the first element of an array that is not consecutive.By not consecutive we mean not exactly 1 larger than the previous element o
Write a function which converts the input string to uppercase.
Deoxyribonucleic acid, DNA is the primary information storage molecule in biological systems. It is composed of four nucleic acid bases Guanine ('G'),
There was a test in your class and you passed it. Congratulations!But you're an ambitious person. You want to know if you're better than the average s
Timmy & Sarah think they are in love, but around where they live, they will only know once they pick a flower each. If one of the flowers has an even
You were camping with your friends far away from home, but when it's time to go back, you realize that your fuel is running out and the nearest pump i
An isogram is a word that has no repeating letters, consecutive or non-consecutive. Implement a function that determines whether a string that contain
This time no story, no theory. The examples below show you how to write function accum:Examples:accum("abcd") -> "A-Bb-Ccc-Dddd"accum("RqaEzty") -> "R
Trolls are attacking your comment section!A common way to deal with this situation is to remove all of the vowels from the trolls' comments, neutraliz
Convert number to reversed array of digitsGiven a random non-negative number, you have to return the digits of this number within an array in reverse
Write a function to convert a name into initials. This kata strictly takes two words with one space in between them.The output should be two capital l
Jenny has written a function that returns a greeting for a user. However, she's in love with Johnny, and would like to greet him slightly different. S
Welcome. In this kata, you are asked to square every digit of a number and concatenate them.For example, if we run 9119 through the function, 811181 w
Given a non-empty array of integers, return the result of multiplying the values together in order. Example:1, 2, 3, 4 => 1 2 3 \* 4 = 24
Let's play! You have to return which player won! In case of a draw return Draw!.Examples:rps('scissors','paper') // Player 1 won!rps('scissors','rock'
Create a function with two arguments that will return an array of the first (n) multiples of (x).Assume both the given number and the number of times
Create a function which answers the question "Are you playing banjo?".If your name starts with the letter "R" or lower case "r", you are playing banjo
Q. Write function RemoveExclamationMarks which removes all exclamation marks from a given string. A) +) replace 라는 메소드가 있나보다... 패턴에 일치하는 일부 또는 모든 부분
Given three integers a ,b ,c, return the largest number obtained after inserting the following operators and brackets: +, , ()In other words , try eve
Your start-up's BA has told marketing that your website has a large audience in Scandinavia and surrounding countries. Marketing thinks it would be gr
The cockroach is one of the fastest insects. Write a function which takes its speed in km per hour and returns it in cm per second, rounded down to th
Write a function named setAlarm which receives two parameters. The first parameter, employed, is true whenever you are employed and the second paramet
The Story:Bob is working as a bus driver. However, he has become extremely popular amongst the city's residents. With so many passengers wanting to ge
Grade bookComplete the function so that it finds the average of the three scores passed to it and returns the letter value associated with that grade.
Take an array and remove every second element from the array. Always keep the first element and start removing with the next element.Example:"Keep", "
Given a string, you have to return a string in which each character (case-sensitive) is repeated once.doubleChar("String") ==> "SSttrriinngg"doubleCha
Complete the function which takes two arguments and returns all numbers which are divisible by the given divisor. First argument is an array of number
After a hard quarter in the office you decide to get some rest on a vacation. So you will book a flight for you and your girlfriend and try to leave a
Character recognition software is widely used to digitise printed texts. Thus the texts can be edited, searched and stored on a computer.When document
The function is not returning the correct values. Can you figure out why?Example (Input --> Output ):3 --> "Earth"break 안써서 흘러내리는 함수를 고치는 문제였다.
I have a cat and a dog.I got them at the same time as kitten/puppy. That was humanYears years ago.Return their respective ages now as humanYears,catYe
Who remembers back to their time in the schoolyard, when girls would take a flower and tear its petals, saying each of the following phrases each time
Create a function that accepts 2 string arguments and returns an integer of the count of occurrences the 2nd argument is found in the first one.If no
You're writing code to control your town's traffic lights. You need a function to handle each change from green, to yellow, to red, and then to green
write me a function stringy that takes a size and returns a string of alternating '1s' and '0s'.the string should start with a 1.a string with size 6
This kata is from check py.checkio.orgYou are given an array with positive numbers and a non-negative number N. You should find the N-th power of the
You get an array of numbers, return the sum of all of the positives ones.Example 1,-4,7,12 => 1 + 7 + 12 = 20Note: if there is nothing to sum, the sum
In this simple exercise, you will create a program that will take two lists of integers, a and b. Each list will consist of 3 positive integers above
Implement a function named generateRange(min, max, step), which takes three arguments and generates a range of integers from min to max, with the step
TaskYour friend advised you to see a new performance in the most popular theater in the city. He knows a lot about art and his advice is usually good,
Complete the function that takes a non-negative integer n as input, and returns a list of all the powers of 2 with the exponent ranging from 0 to n (i
In this little assignment you are given a string of space separated numbers, and have to return the highest and lowest number.Example:highAndLow("1 2
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
Digital root is the recursive sum of all the digits in a number.Given n, take the sum of the digits of n. If that value has more than one digit, conti
You probably know the "like" system from Facebook and other pages. People can "like" blog posts, pictures or other items. We want to create the text t
Jaden Smith, the son of Will Smith, is the star of films such as The Karate Kid (2010) and After Earth (2013). Jaden is also known for some of his phi
Simple, given a string of words, return the length of the shortest word(s).String will never be empty and you do not need to account for different dat
Deoxyribonucleic acid (DNA) is a chemical found in the nucleus of cells and carries the "instructions" for the development and functioning of living o
Check to see if a string has the same amount of 'x's and 'o's. The method must return a boolean and be case insensitive. The string can contain any ch
In this kata you will create a function that takes a list of non-negative integers and strings and returns a new list with the strings filtered out.Ex
In a small town the population is p0 = 1000 at the beginning of a year. The population regularly increases by 2 percent per year and moreover 50 new i
Given the triangle of consecutive odd numbers: 13 15 17 1921 23 25 27 29...Calculate the sum of the numbers in the nth row of t
In a factory a printer prints labels for boxes. For one kind of boxes the printer has to use colors which, for the sake of simplicity, are named with
Given 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
Q. Complete the solution so that it returns true if the first argument(string) passed in ends with the 2nd argument (also a string). Examples: solut
You are given an array (which will have a length of at least 3, but could be very large) containing integers. The array is either entirely comprised o
Welcome.In this kata you are required to, given a string, replace every letter with its position in the alphabet.If anything in the text isn't a lette
Write a function that takes an integer as input, and returns the number of bits that are equal to one in the binary representation of that number. You
Move the first letter of each word to the end of it, then add "ay" to the end of the word. Leave punctuation marks untouched.ExamplespigIt('Pig latin
프로그래머스의 [Lv.3 야근 지수] 문제를 이진 힙으로 풀어보자!