This code does not execute properly. Try to figure out why.
Create a function that takes an integer as an argument and returns "Even" for even numbers or "Odd" for odd numbers.
This kata is about multiplying a given number by eight if it is an even number and by nine otherwise.
Now you have to write a function that takes an argument and returns the square of it.int32_t square(int32_t n){ return (n \* n);}
mplement a function which convert the given boolean value into its string representation.
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
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
IntroductionThe 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,
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, -
Description:We need a function that can transform a number into a string.What ways of achieving this do you know?In C, return a dynamically allocated
Sentence SmashWrite a function that takes an array of words and smashes them together into a sentence and returns the sentence. You can ignore any nee
Simple, remove the spaces from the string, then return the resultant string.For C, you must return a new dynamically allocated string.
Complete the solution so that it reverses the string passed into it.'world' => 'dlrow'메소드를 이렇게 붙여서 바로 리턴하는 게 가능하다.
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
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 given the time i
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 = 3, x = 1,
Your task is to create a function that does four basic mathematical operations.The function should take three arguments - operation(string/char), valu
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
Can you find the needle in the haystack?Write a function findNeedle() that takes an array full of junk but containing one "needle"After your function
Given an array of integers, return a new array with each value doubled.For example:1, 2, 3 --> 2, 4, 6
t's the academic year's end, fateful moment of your school report. The averages must be calculated. All the students come to you and entreat you to ca
Complete the solution so that it reverses all of the words within the string passed in.Example:"The greatest victory is that which requires no battle"
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.풀면서도 요녀석 짧고 쉽게
Make a function that will return a greeting statement that uses an input; your program should return, "Hello, how are you doing today?".Make sure you
You will be given an array a and a value x. All you need to do is check whether the provided array contains the value.Array can contain numbers or str
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풀면서도 뭔가 다른 메소드로 for문을 안 돌아도 될 방법이 있을 것 같은데...🧐 라고
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
You take your son to the forest to see the monkeys. You know that there are a certain number there (n), but your son is too young to just appreciate t
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
It's bonus time in the big city! The fatcats are rubbing their paws in anticipation... but who is going to make the most money?Build a function that t
Write function bmi that calculates body mass index (bmi = weight / height2).if bmi <= 18.5 return "Underweight"if bmi <= 25.0 return "Normal"if
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
Your classmates asked you to copy some paperwork for them. You know that there are 'n' classmates and the paperwork has 'm' pages.Your task is to calc
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
Your task is to make two functions, max and min (maximum and minimum in PHP and Python, maxi and mini in Julia) that take a(n) array/vector of integer
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
Write a function that takes an array of numbers and returns the sum of the numbers. The numbers can be negative or non-integer. If the array does not
Rock Paper ScissorsLet's play! You have to return which player won! In case of a draw return Draw!.Examples:rps('scissors','paper') // Player 1 won!rp
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
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
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 string will only
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
Given an array of integers as strings and numbers, return the sum of the array values as if all were numbers.Return your answer as a number.
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
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
In this little assignment you are given a string of space separated numbers, and have to return the highest and lowest number.ExampleshighAndLow("1 2
Your task is to make a function that can take any non-negative integer as an argument and return it with its digits in descending order. Essentially,
You are going to be given a word. Your job is to return the middle character of the word. If the word's length is odd, return the middle character. If
An isogram is a word that has no repeating letters, consecutive or non-consecutive. Implement a function that determines whether a string that contain
A square of squaresYou like building blocks. You especially like building blocks that are squares. And what you even like more, is to arrange them int
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
Given two integers a and b, which can be positive or negative, find the sum of all the integers between and including them and return it. If the two n
Usually when you buy something, you're asked whether your credit card number, phone number or answer to your most secret question is still correct. Ho
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
Create a function that returns the sum of the two lowest positive numbers given an array of minimum 4 positive integers. No floats or non-positive int
Take 2 strings s1 and s2 including only letters from ato z. Return a new sorted string, the longest possible, containing distinct letters - each taken
Given the triangle of consecutive odd numbers:Calculate the sum of the numbers in the nth row of this triangle (starting at index 1) e.g.: (Input -->
ATM machines allow 4 or 6 digit PIN codes and PIN codes cannot contain anything but exactly 4 digits or exactly 6 digits.If the function is passed a v
You might know some pretty large perfect squares. But what about the NEXT one?Complete the findNextSquare method that finds the next integral perfect
To be a senior, a member must be at least 55 years old and have a handicap greater than 7. In this croquet club, handicaps range from -2 to +26; the b
Make a program that filters a list of strings and returns a list with only your friends name in it.If a name has exactly 4 letters in it, you can be s
Given an array of ones and zeroes, convert the equivalent binary value to an integer.Eg: 0, 0, 0, 1 is treated as 0001 which is the binary representat
Implement a function that adds two numbers together and returns their sum in binary. The conversion can be done before, or after the addition.The bina
Implement a function that accepts 3 integer values a, b, c. The function should return true if a triangle can be built with the sides of given length
There is a bus moving in the city, and it takes and drop some people in each bus stop.You are provided with a list (or array) of integer pairs. Elemen
Create a function named divisors/Divisors that takes an integer n > 1 and returns an array with all of the integer's divisors(except for 1 and the num
Task:Your task is to write a function which returns the sum of following series upto nth term(parameter).Series: 1 + 1/4 + 1/7 + 1/10 + 1/13 + 1/16 +.
Complete the function that accepts a string parameter, and reverses each word in the string. All spaces in the string should be retained.Examples"This
Task: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 i
Complete the solution so that it returns true if the first argument(string) passed in ends with the 2nd argument (also a string).Examples:solution('ab
The museum of incredible dull thingsThe museum of incredible dull things wants to get rid of some exhibitions. Miriam, the interior architect, comes u
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
Don't give me five!In this kata you get the start number and the end number of a region and should return the count of all numbers except numbers with
StoryBen has a very simple idea to make some profit: he buys something and sells it again. Of course, this wouldn't give him any profit at all if he w
Your team is writing a fancy new text editor and you've been tasked with implementing the line numbering.Write a function which takes a list of string
Your task is to split the chocolate bar of given dimension n x m into small squares. Each square is of size 1x1 and unbreakable. Implement a function
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.Finish the solution s
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
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
Write a function that takes in a string of one or more words, and returns the same string, but with all five or more letter words reversed (like the n
Count the number of DuplicatesWrite a function that will return the count of distinct case-insensitive alphabetic characters and numeric digits that o
Your goal in this kata is to implement a difference function, which subtracts one list from another and returns the result.It should remove all values
Write a function, persistence, that takes in a positive parameter num and returns its multiplicative persistence, which is the number of times you mus
The goal of this exercise is to convert a string to a new string where each character in the new string is "(" if that character appears only once in
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
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
You live in the city of Cartesia where all roads are laid out in a perfect grid. You arrived ten minutes too early to an appointment, so you decided t