FOR78 Number of People in the Bus 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. Elements of each pair represent number of people get into bus (The first item) and number of people get off the bus (The second item) in a bus stop. Your task is to return number of people who are still in the bus after the last bus station (after the l.. 2022. 5. 5. Disemvowel Trolls 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, neutralizing the threat. Your task is to write a function that takes a string and return a new string with all vowels removed. For example, the string "This website is for losers LOL!" would become "Ths wbst s fr lsrs LL!". Note: for this kata y isn't cons.. 2022. 5. 5. Categorize New Member The Western Suburbs Croquet Club has two categories of membership, Senior and Open. They would like your help with an application form that will tell prospective members which category they will be placed. 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 better the player the lower the handicap. I.. 2022. 5. 3. Find the vowels We want to know the index of the vowels in a given word, for example, there are two vowels in the word super (the second and fourth letters). So given a string "super", we should return a list of [2, 4]. Some examples: Mmmm => [] Super => [2,4] Apple => [1,5] YoMama -> [1,2,4,6] NOTES Vowels in this context refers to: a e i o u y (including upper case) This is indexed from [1..n] (not zero index.. 2022. 5. 1. Sort array by string length Description: Write a function that takes an array of strings as an argument and returns a sorted array containing the same strings, ordered from shortest to longest. For example, if this array were passed as an argument: ["Telescopes", "Glasses", "Eyes", "Monocles"] Your function would return the following array: ["Eyes", "Glasses", "Monocles", "Telescopes"] All of the strings in the array passe.. 2022. 4. 29. Mumbling Description: 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-Qq-Aaa-Eeee-Zzzzz-Tttttt-Yyyyyyy" accum("cwAt") -> "C-Ww-Aaa-Tttt" The parameter of accum is a string which includes only letters from a..z and A..Z. Solution: 1. Extract each character from a string with an index. 2. Characters ar.. 2022. 4. 27. 이전 1 ··· 4 5 6 7 8 9 10 ··· 13 다음