id
stringlengths
11
14
content
stringlengths
424
1.17M
apps_data_4700
In this Kata, you will be given a multi-dimensional array containing `2 or more` sub-arrays of integers. Your task is to find the maximum product that can be formed by taking any one element from each sub-array. ``` Examples: solve( [[1, 2],[3, 4]] ) = 8. The max product is given by 2 * 4 solve( [[10,-15],[-1,-3]] ) =...
apps_data_4701
Mr Leicester's cheese factory is the pride of the East Midlands, but he's feeling a little blue. It's the time of the year when **the taxman is coming round to take a slice of his cheddar** - and the final thing he has to work out is how much money he's spending on his staff. Poor Mr Leicester can barely sleep he's so ...
apps_data_4702
# Task Given an integer `product`, find the smallest positive integer the product of whose digits is equal to product. If there is no such integer, return -1 instead. # Example For `product = 1`, the output should be `11`; `1 x 1 = 1` (1 is not a valid result, because it has only 1 digit) For `product = 12`, ...
apps_data_4703
The medians of a triangle are the segments that unit the vertices with the midpoint of their opposite sides. The three medians of a triangle intersect at the same point, called the barycenter or the centroid. Given a triangle, defined by the cartesian coordinates of its vertices we need to localize its barycenter or ce...
apps_data_4704
In this kata you must take an input string, reverse the order of the words, and reverse the order of the letters within the words. But, as a bonus, every test input will end with a punctuation mark (! ? .) and the output should be returned with the mark at the end. A few examples should help clarify: ```python esrev...
apps_data_4705
This is the simple version of Fastest Code series. If you need some challenges, please try the [Performance version](http://www.codewars.com/kata/5714594d2817ff681c000783) ## Task: Give you a number array ```numbers``` and a number ```c```. Find out a pair of numbers(we called them number a and number b) from t...
apps_data_4706
# Task You are given a decimal number `n` as a **string**. Transform it into an array of numbers (given as **strings** again), such that each number has only one nonzero digit and their sum equals n. Each number in the output array should be written without any leading and trailing zeros. # Input/Output - `[inpu...
apps_data_4707
In this kata, your task is to write a function `to_bytes(n)` (or `toBytes(n)` depending on language) that produces a list of bytes that represent a given non-negative integer `n`. Each byte in the list is represented by a string of `'0'` and `'1'` of length 8. The most significant byte is first in the list. The example...
apps_data_4708
# Kata Task 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`,`catYears`,`dogYears`] NOTES: * humanYears >= 1 * humanYears are whole numbers only ## Cat Years * `15` cat years for first year * `+9` cat years for ...
apps_data_4709
Consider a sequence, which is formed by the following rule: next term is taken as the smallest possible non-negative integer, which is not yet in the sequence, so that `no 3` terms of sequence form an arithmetic progression. ## Example `f(0) = 0` -- smallest non-negative `f(1) = 1` -- smallest non-negative, which i...
apps_data_4710
In some countries of former Soviet Union there was a belief about lucky tickets. A transport ticket of any sort was believed to posess luck if sum of digits on the left half of its number was equal to the sum of digits on the right half. Here are examples of such numbers: ``` 003111 # 3 = 1 + 1 + 1 81337...
apps_data_4711
Write a program that will calculate the number of trailing zeros in a factorial of a given number. `N! = 1 * 2 * 3 * ... * N` Be careful `1000!` has 2568 digits... For more info, see: http://mathworld.wolfram.com/Factorial.html ## Examples ```python zeros(6) = 1 # 6! = 1 * 2 * 3 * 4 * 5 * 6 = 720 --> 1 trailing ...
apps_data_4712
Lucas numbers are numbers in a sequence defined like this: ``` L(0) = 2 L(1) = 1 L(n) = L(n-1) + L(n-2) ``` Your mission is to complete the function that returns the `n`th term of this sequence. **Note:** It should work for negative numbers as well; how you do this is you flip the equation around, so for negative num...
apps_data_4713
`late_clock` function receive an array with 4 digits and should return the latest time that can be built with those digits. The time should be in `HH:MM` format. Examples: ``` [1, 9, 8, 3] => 19:38 [9, 1, 2, 5] => 21:59 ``` You can suppose the input is correct and you can build from it a correct 24-hour time. from i...
apps_data_4714
## Task Write a method `remainder` which takes two integer arguments, `dividend` and `divisor`, and returns the remainder when dividend is divided by divisor. Do NOT use the modulus operator (%) to calculate the remainder! #### Assumption Dividend will always be `greater than or equal to` divisor. #### Notes Make ...
apps_data_4715
## Task Given a string, add the fewest number of characters possible from the front or back to make it a palindrome. ## Example For the input `cdcab`, the output should be `bacdcab` ## Input/Output Input is a string consisting of lowercase latin letters with length 3 <= str.length <= 10 The output is a palindrome...
apps_data_4716
# Task In the field, two beggars A and B found some gold at the same time. They all wanted the gold, and they decided to use simple rules to distribute gold: ``` They divided gold into n piles and be in line. The amount of each pile and the order of piles all are randomly. They took turns to take away a pile of gold...
apps_data_4717
## Task: You have to write a function **pattern** which returns the following Pattern(See Examples) upto (2n-1) rows, where n is parameter. ### Rules/Note: * If the Argument is 0 or a Negative Integer then it should return "" i.e. empty string. * All the lines in the pattern have same length i.e equal to the number o...
apps_data_4718
Write a function ```x(n)``` that takes in a number ```n``` and returns an ```nxn``` array with an ```X``` in the middle. The ```X``` will be represented by ```1's``` and the rest will be ```0's```. E.g. ```python x(5) == [[1, 0, 0, 0, 1], [0, 1, 0, 1, 0], [0, 0, 1, 0, 0], [0, 1, 0, 1, 0]...
apps_data_4719
You are given an array of integers. Your task is to sort odd numbers within the array in ascending order, and even numbers in descending order. Note that zero is an even number. If you have an empty array, you need to return it. For example: ``` [5, 3, 2, 8, 1, 4] --> [1, 3, 8, 4, 5, 2] odd numbers ascending: [...
apps_data_4720
In this kata, we will check is an array is (hyper)rectangular. A rectangular array is an N-dimensional array with fixed sized within one dimension. Its sizes can be repsented like A1xA2xA3...xAN. That means a N-dimensional array has N sizes. The 'As' are the hyperrectangular properties of an array. You should implem...
apps_data_4721
Write a function ```convert_temp(temp, from_scale, to_scale)``` converting temperature from one scale to another. Return converted temp value. Round converted temp value to an integer(!). Reading: http://en.wikipedia.org/wiki/Conversion_of_units_of_temperature ``` possible scale inputs: "C" for Celsius "F...
apps_data_4722
# Challenge : Write a function that takes a single argument `n` that is a string representation of a simple mathematical expression and evaluates it as a floating point value. # Commands : - positive or negative decimal numbers - `+, -, *, /, ( / ).` --- Expressions use [infix notation](https://en.wikipedia.org/...
apps_data_4723
Write a method that takes one argument as name and then greets that name, capitalized and ends with an exclamation point. Example: ``` "riley" --> "Hello Riley!" "JACK" --> "Hello Jack!" ``` def greet(name): return f'Hello {name.title()}!' def greet(name): return f"Hello {name.capitalize()}!" def greet(...
apps_data_4724
DropCaps means that the first letter of the starting word of the paragraph should be in caps and the remaining lowercase, just like you see in the newspaper. But for a change, let's do that for each and every word of the given String. Your task is to capitalize every word that has length greater than 2, leaving small...
apps_data_4725
Impliment the reverse function, which takes in input n and reverses it. For instance, `reverse(123)` should return `321`. You should do this without converting the inputted number into a string. def reverse(n): m = 0 while n > 0: n, m = n // 10, m * 10 + n % 10 return m def reverse(n): return ...
apps_data_4726
Given a string `s` of uppercase letters, your task is to determine how many strings `t` (also uppercase) with length equal to that of `s` satisfy the followng conditions: * `t` is lexicographical larger than `s`, and * when you write both `s` and `t` in reverse order, `t` is still lexicographical larger than `s`. ``...
apps_data_4727
**This Kata is intended as a small challenge for my students** Create a function, called ``removeVowels`` (or ``remove_vowels``), that takes a string argument and returns that same string with all vowels removed (vowels are "a", "e", "i", "o", "u"). REMOVE_VOWS = str.maketrans('','','aeiou') def remove_vowels(s): ...
apps_data_4728
Complete the function so that it takes an array of keys and a default value and returns a hash (Ruby) / dictionary (Python) with all keys set to the default value. ## Example ```python ["draft", "completed"], 0 # should return {"draft": 0, "completed: 0} ``` def populate_dict(keys, default): return {key: defa...
apps_data_4729
If we write out the digits of "60" as English words we get "sixzero"; the number of letters in "sixzero" is seven. The number of letters in "seven" is five. The number of letters in "five" is four. The number of letters in "four" is four: we have reached a stable equilibrium. Note: for integers larger than 9, write ou...
apps_data_4730
We need a function ```prime_bef_aft()``` that gives the largest prime below a certain given value ```n```, ```befPrime or bef_prime``` (depending on the language), and the smallest prime larger than this value, ```aftPrime/aft_prime``` (depending on the language). The result should be output in a list like the f...
apps_data_4731
It is 2050 and romance has long gone, relationships exist solely for practicality. MatchMyHusband is a website that matches busy working women with perfect house husbands. You have been employed by MatchMyHusband to write a function that determines who matches!! The rules are... a match occurs providing the husband's...
apps_data_4732
Your job is to figure out the index of which vowel is missing from a given string: * `A` has an index of 0, * `E` has an index of 1, * `I` has an index of 2, * `O` has an index of 3, * `U` has an index of 4. **Notes:** There is no need for string validation and every sentence given will contain all vowles but one. ...
apps_data_4733
Quantum mechanics tells us that a molecule is only allowed to have specific, discrete amounts of internal energy. The 'rigid rotor model', a model for describing rotations, tells us that the amount of rotational energy a molecule can have is given by: `E = B * J * (J + 1)`, where J is the state the molecule is in...
apps_data_4734
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 takes in two arguments (salary, bonus). Salary will be an integer, and bonus a boolean. If bonus is true, the salary should be multiplied by 10. If bonus is false, the...
apps_data_4735
#### Task: Your job here is to write a function (`keepOrder` in JS/CoffeeScript, `keep_order` in Ruby/Crystal/Python, `keeporder` in Julia), which takes a sorted array `ary` and a value `val`, and returns the lowest index where you could insert `val` to maintain the sorted-ness of the array. The input array will alway...
apps_data_4736
How many bees are in the beehive? * bees can be facing UP, DOWN, LEFT, or RIGHT * bees can share parts of other bees Examples Ex1 ``` bee.bee .e..e.. .b..eeb ``` *Answer: 5* Ex2 ``` bee.bee e.e.e.e eeb.eeb ``` *Answer: 8* # Notes * The hive may be empty or null/None/nil/... * Python: the hive is passe...
apps_data_4737
```if:python,php In this kata you will have to write a function that takes `litres` and `price_per_litre` as arguments. Purchases of 2 or more litres get a discount of 5 cents per litre, purchases of 4 or more litres get a discount of 10 cents per litre, and so on every two litres, up to a maximum discount of 25 cents ...
apps_data_4738
## The Riddle The King of a small country invites 1000 senators to his annual party. As a tradition, each senator brings the King a bottle of wine. Soon after, the Queen discovers that one of the senators is trying to assassinate the King by giving him a bottle of poisoned wine. Unfortunately, they do not know which s...
apps_data_4739
We have the numbers with different colours with the sequence: ['red', 'yellow', 'blue']. That sequence colours the numbers in the following way: 1 2 3 4 5 6 7 8 9 10 11 12 13 ..... We have got the following recursive function: ``` f(1) = 1 f(n) = f(n - 1) + n ``` Some terms of this seque...
apps_data_4740
Given the triangle of consecutive odd numbers: ``` 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 ... ``` Calculate the row sums of this triangle from the row index (starting at index 1) e.g.: ```python row_sum_odd_numbers(1); # 1 row_sum_odd_numbers(2); # 3 ...
apps_data_4741
Given a standard english sentence passed in as a string, write a method that will return a sentence made up of the same words, but sorted by their first letter. However, the method of sorting has a twist to it: * All words that begin with a lower case letter should be at the beginning of the sorted sentence, and sorted...
apps_data_4742
You are given array of integers, your task will be to count all pairs in that array and return their count. **Notes:** * Array can be empty or contain only one value; in this case return `0` * If there are more pairs of a certain number, count each pair only once. E.g.: for `[0, 0, 0, 0]` the return value is `2` ...
apps_data_4743
## Task In your favorite game, you must shoot a target with a water-gun to gain points. Each target can be worth a different amount of points. You are guaranteed to hit every target that you try to hit. You cannot hit consecutive targets though because targets are only visible for one second (one at a time) and it...
apps_data_4744
My friend wants a new band name for her band. She like bands that use the formula: "The" + a noun with the first letter capitalized, for example: `"dolphin" -> "The Dolphin"` However, when a noun STARTS and ENDS with the same letter, she likes to repeat the noun twice and connect them together with the first and last...
apps_data_4745
Ever since you started work at the grocer, you have been faithfully logging down each item and its category that passes through. One day, your boss walks in and asks, "Why are we just randomly placing the items everywhere? It's too difficult to find anything in this place!" Now's your chance to improve the system, impr...
apps_data_4746
# How much is the fish! (- Scooter ) The ocean is full of colorful fishes. We as programmers want to know the hexadecimal value of these fishes. ## Task Take all hexadecimal valid characters (a,b,c,d,e,f) of the given name and XOR them. Return the result as an integer. ## Input The input is always a string, which can...
apps_data_4747
```if-not:racket Write a function called `repeat_str` which repeats the given string `src` exactly `count` times. ``` ```if:racket Write a function called `repeat-string` which repeats the given string `str` exactly `count` times. ``` def repeat_str(repeat, string): return repeat * string def repeat_str(a,b): ...
apps_data_4748
This is a follow up from my kata Insert Dashes. Write a function ```insertDashII(num)``` that will insert dashes ('-') between each two odd numbers and asterisk ('\*') between each even numbers in ```num``` For example: ```insertDashII(454793)``` --> 4547-9-3 ```insertDashII(1012356895)``` --> 10123-56*89-5 Zero...
apps_data_4749
Uh oh, Someone at the office has dropped all these sequences on the floor and forgotten to label them with their correct bases. We have to fix this before the boss gets back or we're all going to be fired! This is what your years of coding have been leading up to, now is your time to shine! ## Task You will have t...
apps_data_4750
Write a function that flattens an `Array` of `Array` objects into a flat `Array`. Your function must only do one level of flattening. ```python flatten [1,2,3] # => [1,2,3] flatten [[1,2,3],["a","b","c"],[1,2,3]] # => [1,2,3,"a","b","c",1,2,3] flatten [[[1,2,3]]] # => [[1,2,3]] ``` def flatten(lst): r = [] ...
apps_data_4751
For a given two numbers your mission is to derive a function that evaluates whether two given numbers are **abundant**, **deficient** or **perfect** and whether together they are **amicable**. ### Abundant Numbers An abundant number or excessive number is a number for which the sum of its proper divisors is greater ...
apps_data_4752
Similar to the [previous kata](https://www.codewars.com/kata/string-subpattern-recognition-ii/), but this time you need to operate with shuffled strings to identify if they are composed repeating a subpattern Since there is no deterministic way to tell which pattern was really the original one among all the possible p...
apps_data_4753
Write a function, `gooseFilter` / `goose-filter` / `goose_filter` /` GooseFilter`, that takes an array of strings as an argument and returns a filtered array containing the same elements but with the 'geese' removed. The geese are any strings in the following array, which is pre-populated in your solution: ```python ...
apps_data_4754
Hi! Welcome to my first kata. In this kata the task is to take a list of integers (positive and negative) and split them according to a simple rule; those ints greater than or equal to the key, and those ints less than the key (the itself key will always be positive). However, in this kata the goal is to sort the num...
apps_data_4755
Every non-negative integer N has a binary representation.  For example, 5 can be represented as "101" in binary, 11 as "1011" in binary, and so on.  Note that except for N = 0, there are no leading zeroes in any binary representation. The complement of a binary representation is the number in binary you get when changi...
apps_data_4756
=====Function Descriptions===== re.findall() The expression re.findall() returns all the non-overlapping matches of patterns in a string as a list of strings. Code >>> import re >>> re.findall(r'\w','http://www.hackerrank.com/') ['h', 't', 't', 'p', 'w', 'w', 'w', 'h', 'a', 'c', 'k', 'e', 'r', 'r', 'a', 'n', 'k', 'c'...
apps_data_4757
You are given four positive integers $n$, $m$, $a$, $b$ ($1 \le b \le n \le 50$; $1 \le a \le m \le 50$). Find any such rectangular matrix of size $n \times m$ that satisfies all of the following conditions: each row of the matrix contains exactly $a$ ones; each column of the matrix contains exactly $b$ ones; all ...
apps_data_4758
Let's just place tokens on a connect four board. ** INPUT ** Provided as input the list of columns where a token is placed, from 0 to 6 included. The first player starting is the yellow one (marked with `Y`), then the red (marked with `R`); the other cells might be empty and marked with `-`. ** OUTPUT ** The outp...
apps_data_4759
Write function toAcronym which takes a string and make an acronym of it. Rule of making acronym in this kata: 1. split string to words by space char 2. take every first letter from word in given string 3. uppercase it 4. join them toghether Eg: Code wars -> C, w -> C W -> CW def to_acronym(input): # only call...
apps_data_4760
A [binary search tree](https://en.wikipedia.org/wiki/Binary_search_tree) is a binary tree that is ordered. This means that if you were to convert the tree to an array using an in-order traversal, the array would be in sorted order. The benefit gained by this ordering is that when the tree is balanced, searching is a lo...
apps_data_4761
This kata is about singly linked list. A linked list is an ordered set of data elements, each containing a link to its successor (and sometimes its predecessor, known as a double linked list). You are you to implement an algorithm to find the kth to last element. For example given a linked list of: a -> b -> c -> d...
apps_data_4762
The business has been suffering for years under the watch of Homie the Clown. Every time there is a push to production it requires 500 hands-on deck, a massive manual process, and the fire department is on stand-by along with Fire Marshall Bill the king of manual configuration management. He is called a Fire Marshall b...
apps_data_4763
Each test case will generate a variable whose value is 777. Find the name of the variable. def find_variable(): return next(k for k,v in globals().items() if v == 777) def find_variable(): d = globals() for x in d["VVV"]: if d[x] == 777: return x def find_variable(): for k, v in g...
apps_data_4764
Given a matrix represented as a list of string, such as ``` ###..... ..###... ....###. .....### .....### ....###. ..###... ###..... ``` write a function ```if:javascript `rotateClockwise(matrix)` ``` ```if:ruby,python `rotate_clockwise(matrix)` ``` that return its 90° clockwise rotation, for our example: ``` #......# ...
apps_data_4765
```if:csharp ## Terminal Game - Create Hero Class In this first kata in the series, you need to define a Hero class to be used in a terminal game. The hero should have the following attributes: attribute | type | value ---|---|--- Name | string | user argument or "Hero" Position | string | "00" Health | float | 100 D...
apps_data_4766
This the second part part of the kata: https://www.codewars.com/kata/the-sum-and-the-rest-of-certain-pairs-of-numbers-have-to-be-perfect-squares In this part we will have to create a faster algorithm because the tests will be more challenging. The function ```n_closestPairs_tonum()```, (Javascript: ```nClosestPairsT...
apps_data_4767
Given a certain array of positive and negative numbers, give the longest increasing or decreasing combination of elements of the array. If our array is ```a = [a[0], a[1], ....a[n-1]]```: i) For the increasing case: there is a combination: ```a[i] < a[j] < a[k]..< a[p]```, such that ```0 ≤ i < j < k < ...< p ≤ n - 1`...
apps_data_4768
A company is opening a bank, but the coder who is designing the user class made some errors. They need you to help them. You must include the following: - A withdraw method - Subtracts money from balance - One parameter, money to withdraw - Raise ValueError if there isn't enough money to withdraw - Return ...
apps_data_4769
Find the area of a rectangle when provided with one diagonal and one side of the rectangle. If the input diagonal is less than or equal to the length of the side, return "Not a rectangle". If the resultant area has decimals round it to two places. `This kata is meant for beginners. Rank and upvote to bring it out of b...
apps_data_4770
# Kata Task A bird flying high above a mountain range is able to estimate the height of the highest peak. Can you? # Example ## The birds-eye view ^^^^^^ ^^^^^^^^ ^^^^^^^ ^^^^^ ^^^^^^^^^^^ ^^^^^^ ^^^^ ## The bird-brain calculations 111111 1^^^^111 1^^^^11 1^^^1 1^^^^111111 1^^^11 1111 ...
apps_data_4771
Caesar Ciphers are one of the most basic forms of encryption. It consists of a message and a key, and it shifts the letters of the message for the value of the key. Read more about it here: https://en.wikipedia.org/wiki/Caesar_cipher ## Your task Your task is to create a function encryptor that takes 2 arguments -...
apps_data_4772
The 26 letters of the English alphabets are randomly divided into 5 groups of 5 letters with the remaining letter being ignored. Each of the group is assigned a score of more than 0. The ignored letter always has a score of 0. With this kata, write a function ```nameScore(name)``` to work out the score of a name tha...
apps_data_4773
Given a list of prime factors, ```primesL```, and an integer, ```limit```, try to generate in order, all the numbers less than the value of ```limit```, that have **all and only** the prime factors of ```primesL``` ## Example ```python primesL = [2, 5, 7] limit = 500 List of Numbers Under 500 Prime Factorizat...
apps_data_4774
We'll create a function that takes in two parameters: * a sequence (length and types of items are irrelevant) * a function (value, index) that will be called on members of the sequence and their index. The function will return either true or false. Your function will iterate through the members of the sequence in ord...
apps_data_4775
The fusc function is defined recursively as follows: 1. fusc(0) = 0 2. fusc(1) = 1 3. fusc(2 * n) = fusc(n) 4. fusc(2 * n + 1) = fusc(n) + fusc(n + 1) The 4 rules above are sufficient to determine the value of `fusc` for any non-negative input `n`. For example, let's say you want to compute `fusc...
apps_data_4776
Be u(n) a sequence beginning with: ``` u[1] = 1, u[2] = 1, u[3] = 2, u[4] = 3, u[5] = 3, u[6] = 4, u[7] = 5, u[8] = 5, u[9] = 6, u[10] = 6, u[11] = 6, u[12] = 8, u[13] = 8, u[14] = 8, u[15] = 10, u[16] = 9, u[17] = 10, u[18] = 11, u[19] = 11, u[20] = 12, u[21] = 12, u[22] = 12, u[23] = 12 etc......
apps_data_4777
In this kata, your task is to write a function that returns the smallest and largest integers in an unsorted string. In this kata, a range is considered a finite sequence of consecutive integers. Input Your function will receive two arguments: A string comprised of integers in an unknown range; think of this string as...
apps_data_4778
You're going on a trip with some students and it's up to you to keep track of how much money each Student has. A student is defined like this: ```python class Student: def __init__(self, name, fives, tens, twenties): self.name = name self.fives = fives self.tens = tens self.twenties...
apps_data_4779
[comment]: # (Hello Contributors, the following guidelines in order of importance should help you write new translations and squash any pesky unintended bugs.) [//]: # (The epsilon of all floating point test case comparisons is 0.01.) [//]: # (Each test case shall pass if the statement "a^2 + b^2 = c^2" is true of the ...
apps_data_4780
Everybody loves **pi**, but what if **pi** were a square? Given a number of digits ```digits```, find the smallest integer whose square is greater or equal to the sum of the squares of the first ```digits``` digits of pi, including the ```3``` before the decimal point. **Note:** Test cases will not extend beyond 100 d...
apps_data_4781
# Background A spider web is defined by * "rings" numbered out from the centre as `0`, `1`, `2`, `3`, `4` * "radials" labelled clock-wise from the top as `A`, `B`, `C`, `D`, `E`, `F`, `G`, `H` Here is a picture to help explain: # Web Coordinates As you can see, each point where the rings and the radials inte...
apps_data_4782
In Scala, an underscore may be used to create a partially applied version of an infix operator using placeholder syntax. For example, `(_ * 3)` is a function that multiplies its input by 3. With a bit of manipulation, this idea can be extended to work on any arbitrary expression. Create an value/object named `x` that ...
apps_data_4783
## Debug celsius converter Your friend is traveling abroad to the United States so he wrote a program to convert fahrenheit to celsius. Unfortunately his code has some bugs. Find the errors in the code to get the celsius converter working properly. To convert fahrenheit to celsius: ``` celsius = (fahrenheit - 32) * ...
apps_data_4784
Convert the 8-bit grayscale input image (2D-list) into an ASCII-representation. ``` _____/\\\\\\\\\________/\\\\\\\\\\\__________/\\\\\\\\\__/\\\\\\\\\\\__/\\\\\\\\\\\_ ___/\\\\\\\\\\\\\____/\\\/////////\\\_____/\\\////////__\/////\\\///__\/////\\\///__ __/\\\/////////\\\__\//\\\______\///____/\\\/__...
apps_data_4785
#Task: Write a function `get_member_since` which accepts a username from someone at Codewars and returns an string containing the month and year separated by a space that they joined CodeWars. ###If you want/don't want your username to be in the tests, ask me in the discourse area. There can't be too many though becau...
apps_data_4786
*** Nova polynomial derivative*** This kata is from a series on polynomial handling. ( [#1](http://www.codewars.com/kata/nova-polynomial-1-add-1) [#2](http://www.codewars.com/kata/570eb07e127ad107270005fe) [#3](http://www.codewars.com/kata/5714041e8807940ff3001140 ) [#4](http://www.codewars.com/kata/571a2e2df24b...
apps_data_4787
# Description: Move all exclamation marks to the end of the sentence # Examples ``` remove("Hi!") === "Hi!" remove("Hi! Hi!") === "Hi Hi!!" remove("Hi! Hi! Hi!") === "Hi Hi Hi!!!" remove("Hi! !Hi Hi!") === "Hi Hi Hi!!!" remove("Hi! Hi!! Hi!") === "Hi Hi Hi!!!!" ``` def remove(s): return s.replace('!','') + s.c...
apps_data_4788
My 5th kata, and 1st in a planned series of rock climbing themed katas. In rock climbing ([bouldering](https://en.wikipedia.org/wiki/Bouldering) specifically), the V/Vermin (USA) climbing grades start at `'VB'` (the easiest grade), and then go `'V0'`, `'V0+'`, `'V1'`, `'V2'`, `'V3'`, `'V4'`, `'V5'` etc. up to `'V17'` ...
apps_data_4789
# An introduction to propositional logic Logic and proof theory are fields that study the formalization of logical statements and the structure of valid proofs. One of the most common ways to represent logical reasonings is with **propositional logic**. A propositional formula is no more than what you normally use in...
apps_data_4790
The mean and standard deviation of a sample of data can be thrown off if the sample contains one or many outlier(s) : (image source) For this reason, it is usually a good idea to check for and remove outliers before computing the mean or the standard deviation of a sample. To this aim, your function will receive a l...
apps_data_4791
Write a function that takes a string and returns an array containing binary numbers equivalent to the ASCII codes of the characters of the string. The binary strings should be eight digits long. Example: `'man'` should return `[ '01101101', '01100001', '01101110' ]` def word_to_bin(word): return ['{:08b}'.format(...
apps_data_4792
```if-not:javascript,python Write function `parseFloat` which takes an input and returns a number or `Nothing` if conversion is not possible. ``` ```if:python Write function `parse_float` which takes a string/list and returns a number or 'none' if conversion is not possible. ``` ```if:javascript Write function `parse...
apps_data_4793
Write a function that takes an integer in input and outputs a string with currency format. Integer in currency format is expressed by a string of number where every three characters are separated by comma. For example: ``` 123456 --> "123,456" ``` Input will always be an positive integer, so don't worry about type...
apps_data_4794
# Task Let's say that number a feels comfortable with number b if a ≠ b and b lies in the segment` [a - s(a), a + s(a)]`, where `s(x)` is the sum of x's digits. How many pairs (a, b) are there, such that a < b, both a and b lie on the segment `[L, R]`, and each number feels comfortable with the other? # Example F...
apps_data_4795
We will use the Flesch–Kincaid Grade Level to evaluate the readability of a piece of text. This grade level is an approximation for what schoolchildren are able to understand a piece of text. For example, a piece of text with a grade level of 7 can be read by seventh-graders and beyond. The way to calculate the grade ...
apps_data_4796
Linked Lists - Get Nth Implement a GetNth() function that takes a linked list and an integer index and returns the node stored at the Nth index position. GetNth() uses the C numbering convention that the first node is index 0, the second is index 1, ... and so on. So for the list 42 -> 13 -> 666, GetNth() with index 1...
apps_data_4797
Given 2 strings, `a` and `b`, return a string of the form: `shorter+reverse(longer)+shorter.` In other words, the shortest string has to be put as prefix and as suffix of the reverse of the longest. Strings `a` and `b` may be empty, but not null (In C# strings may also be null. Treat them as if they are empty.). I...
apps_data_4798
Given a certain square matrix ```A```, of dimension ```n x n```, that has negative and positive values (many of them may be 0). We need the following values rounded to the closest integer: - the average of all the positive numbers (more or equal to 0) that are in the principal diagonal and in the columns with odd ind...
apps_data_4799
Let us define a function `f`such as: - (1) for k positive odd integer > 2 : - (2) for k positive even integer >= 2 : - (3) for k positive integer > 1 : where `|x|` is `abs(x)` and Bk the kth Bernoulli number. `f` is not defined for `0, 1, -1`. These values will not be tested. # Guidelines for Bernoulli ...