task
stringlengths
0
154k
__index_level_0__
int64
0
39.2k
When two blocks of the same "type" are adjacent to each other, the entire contiguous block disappears (pops off). If this occurs, this can allow previously separated blocks to be in contact with each other, setting off a chain reaction. After each pop, the remaining items get pushed back before popping the next consecu...
5,500
You have been speeding on a motorway and a police car had to stop you. The policeman is a funny guy that likes to play games. Before issuing penalty charge notice he gives you a choice to change your penalty. Your penalty charge is a combination of numbers like: speed of your car, speed limit in the area, speed of th...
5,501
Find the first character that repeats in a String and return that character. ```javascript firstDup('tweet') => 't' firstDup('like') => undefined ``` ```python first_dup('tweet') => 't' first_dup('like') => None ``` ```haskell firstDup "tweet" `shouldBe` Just 't' firstDup (repeat ()) `shouldBe` Just () fi...
5,502
### Task The function is given a list of `prerequisites` needed to complete some jobs. The list contains pairs `(j, i)`, where job `j` can start after job `i` has been completed. A job can have multiple dependencies or have no dependencies at all. If a job has no dependencies, it can be completed immediately. The funct...
5,503
You have been hired by a large stout brewery in order to improve the quality testing of their beer. Your superiors want you to devise a way of determining whether a batch of beer is likely to be good enough for sale using a small sample of beers from this batch. Luckily for you, a smart Englishman found a solution to t...
5,504
## Task: Write a function that takes a CSV (format shown below) and a sequence of indices, which represents the columns of the CSV, and returns a CSV with only the columns specified in the indices sequence. ## CSV format: The CSV passed in will be a string and will have one or more columns, and one or more rows. Th...
5,505
Although shapes can be very different by nature, they can be sorted by the size of their area. <b style='font-size:16px'>Task:</b> <ul> <li>Create different shapes that can be part of a sortable list. The sort order is based on the size of their respective areas: <ul> <li>The area of a <i><b style="color:lightgreen...
5,506
**See Also** * [Traffic Lights - one car](.) * [Traffic Lights - multiple cars](https://www.codewars.com/kata/5d230e119dd9860028167fa5) --- # Overview A character string represents a city road. Cars travel on the road obeying the traffic lights.. Legend: * `.` = Road * `C` = Car * `G` = <span style='color:black;ba...
5,507
In this Kata you have to find the factors of <code>integer</code> down to the <code>limit</code> including the limiting number. There will be no negative numbers. Return the result as an array of numbers in ascending order. If the <code>limit</code> is more than the <code>integer</code>, return an empty list As a ch...
5,508
Imagine if there were no order of operations. Instead, you would do the problem from left to right. For example, the equation `$a +b *c /d$` would become `$(((a+b)*c)//d)$` (`Math.floor(((a+b)*c)/d)` in JS). Return `None`/`null` (depending on your language) if the equation is `""`. ### Task: Given an equation with a...
5,509
*It seemed a good idea at the time...* # <span style='color:red'>Why I did it?</span> After a year on **Codewars** I really needed a holiday... But not wanting to drift backwards in the honour rankings while I was away, I hatched a cunning plan! # <span style='color:red'>The Cunning Plan</spac> So I borrowed my fr...
5,510
A checksum is an algorithm that scans a packet of data and returns a single number. The idea is that if the packet is changed, the checksum will also change, so checksums are often used for detecting transmission errors, validating document contents, and in many other situations where it is necessary to detect undesira...
5,511
In a computer operating system that uses paging for virtual memory management, page replacement algorithms decide which memory pages to page out when a page of memory needs to be allocated. Page replacement happens when a requested page is not in memory (page fault) and a free page cannot be used to satisfy the allocat...
5,512
```if:python Given a sorted array of distinct integers, write a function `index_equals_value` that returns the lowest index for which `array[index] == index`. Return `-1` if there is no such index. ``` ```if:haskell,javascript Given a sorted array of distinct integers, write a function `indexEqualsValue` that returns...
5,513
In a far away country called AlgoLandia, there are `N` islands numbered `1` to `N`. Each island is denoted by `k[i]`. King Algolas, king of AlgoLandia, built `N - 1` bridges in the country. A bridge is built between islands `k[i]` and `k[i+1]`. Bridges are two-ways and are expensive to build. The problem is that there...
5,514
Given a certain array of integers, create a function that may give the minimum number that may be divisible for all the numbers of the array. ```python min_special_mult([2, 3 ,4 ,5, 6, 7]) == 420 ``` ```ruby min_special_mult([2, 3 ,4 ,5, 6, 7]) == 420 ``` The array may have integers that occurs more than once: ```pyth...
5,515
Given two arrays, the purpose of this Kata is to check if these two arrays are the same. "The same" in this Kata means the two arrays contains arrays of 2 numbers which are same and not necessarily sorted the same way. i.e. <code>[[2,5], [3,6]]</code> is same as <code>[[5,2], [3,6]]</code> or <code>[[6,3], [5,2]]</code...
5,516
```if:python,php In this kata you will have to write a function that takes `litres` and `price_per_litre` (**in dollar**) as arguments. ``` ```if:csharp,java,javascript In this kata you will have to write a function that takes `litres` and `pricePerLitre` (**in dollar**) as arguments. ``` Purchases of 2 or more litr...
5,517
In this kata, you will sort elements in an array by decreasing frequency of elements. If two elements have the same frequency, sort them by increasing value. ```haskell solve([2,3,5,3,7,9,5,3,7]) = [3,3,3,5,5,7,7,2,9] -- We sort by highest frequency to lowest frequency. -- If two elements have same frequency, we sort...
5,518
Your task is to define a function that understands basic mathematical expressions and solves them. For example: ```python calculate("1 + 1") # => 2 calculate("18 + 4*6") # => 42 calculate("245 - 826") # => -581 calculate("09 + 000482") # => 491 calculate("8 / 4 + 6") # => 8 calculate("5 + 1 / 5") ...
5,519
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 entreat you to calculate their average for them. Easy ! You just need to write a script. Return the average of the given array rounded **down** to its nearest integer. The array will n...
5,520
In the drawing below we have a part of the Pascal's triangle, lines are numbered from **zero** (top). The left diagonal in pale blue with only numbers equal to 1 is diagonal **zero**, then in dark green (1, 2, 3, 4, 5, 6, 7) is diagonal 1, then in pale green (1, 3, 6, 10, 15, 21) is diagonal 2 and so on. We want to c...
5,521
Your task is to implement a simple regular expression parser. We will have a parser that outputs the following AST of a regular expression: ```haskell data RegExp = Normal Char -- ^ A character that is not in "()*|." | Any -- ^ Any character | ZeroOrMore RegExp -- ^ Zero or ...
5,522
You have to create a function `calcType`, which receives 3 arguments: 2 numbers, and the result of an unknown operation performed on them (also a number). Based on those 3 values you have to return a string, that describes which operation was used to get the given result. The possible return strings are: `"additio...
5,523
You're a support engineer and you have to write a regex that captures the following information from our log files: - the date - the log level (ERROR, INFO or DEBUG), - the user - the main function - the sub function - the logged message You asked your supervisor about the rules defining all the logs. He told you th...
5,524
_Yet another easy kata!_ ## Task: You are given a word `target` and list of sorted(by length(increasing), number of upper case letters(decreasing), natural order) unique words `words` which always contains `target`, your task is to find the index(0 based) of `target` in `words`,which would always be in the list. ...
5,525
#### Complete the method so that it does the following: - Removes any duplicate query string parameters from the url (the first occurence should be kept) - Removes any query string parameters specified within the 2nd argument (optional array) #### Examples: ```javascript stripUrlParams('www.codewars.com?a=1&b=2&a=2...
5,526
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...
5,527
I highly recommend listening Vivaldi's Four Seasons as an inspiration to solve this Kata :) In the UK, winter begins on 21 December and ends on 20 March. Spring begins on 21 March and ends on 20 June. Summer begins on 21 June and ends on 20 September. Autumn begins on 21 September and ends on 20 December. Given a da...
5,528
This time we learn two methods to split or merge string:```split()``` and ```concat()```. also learn a good friend of the split() method: ```join()```. It is an Array method. Their usage: ```javascript stringObject.split(separator,howmany) stringObject.concat(string1,string2,...,stringx) arrayObject.join(separator) ``...
5,529
# Background Today is the special day you've been waiting for — it's your birthday! It's 8 AM and you're setting up your birthday cake for the party. It's time to put the candles on top. You take out all the candles you've bought. As you are about to put them on the cake, you just realize that there are numbers on ea...
5,530
Write a function that when given a number >= 0, returns an Array of ascending length subarrays. ``` pyramid(0) => [ ] pyramid(1) => [ [1] ] pyramid(2) => [ [1], [1, 1] ] pyramid(3) => [ [1], [1, 1], [1, 1, 1] ] ``` **Note:** the subarrays should be filled with `1`s ```if:c Subarrays should not overlap; this will be ...
5,531
In this simple assignment you are given a number and have to make it negative. But maybe the number is already negative? ### Examples ``` text Input: 1 => Output: -1 Input: -5 => Output: -5 Input: 0 => Output: 0 ``` ``` c makeNegative(1); // return -1 makeNegative(-5); // return -5 makeNegative(0); // retu...
5,532
Lucy loves to travel. Luckily she is a renowned computer scientist and gets to travel to international conferences using her department's budget. Each year, Society for Exciting Computer Science Research (SECSR) organizes several conferences around the world. Lucy always picks one conference from that list that is h...
5,533
# Description There is a narrow hallway in which people can go right and left only. When two people meet in the hallway, by tradition they must salute each other. People move at the same speed left and right. Your task is to write a function that, given a string representation of people moving in the hallway, will co...
5,534
You are given a list of unique integers `arr`, and two integers `a` and `b`. Your task is to find out whether or not `a` and `b` appear consecutively in `arr`, and return a boolean value (`True` if `a` and `b` are consecutive, `False` otherwise). It is guaranteed that `a` and `b` are both present in `arr`. ~~~if:lam...
5,535
Given two arrays `a` and `b` write a function `comp(a, b)` (or`compSame(a, b)`) that checks whether the two arrays have the "same" elements, with the same *multiplicities* (the multiplicity of a member is the number of times it appears). "Same" means, here, that the elements in `b` are the elements in `a` squared, rega...
5,536
## Task Write a function which accepts a sequence of unique integers ( `0 <= x < 32` ) as an argument and returns a 32-bit integer such that the integer, in its binary representation, has `1` at only those indices, numbered from right to left, which are in the sequence. ## Examples `[0, 1] -> 3` `[1, 2, 0, 4] -...
5,537
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 letter, ignore it and don't return it. `"a" = 1`, `"b" = 2`, etc. ## Example <!-- unlisted languages will use the first entry. please keep python up top. --> ```python ...
5,538
Who knows the nursery rhyme <a href="https://www.youtube.com/watch?v=Ak7kedzR8bg">Ten Green Bottles</a>? Lyrics: ``` Ten green bottles hanging on the wall, Ten green bottles hanging on the wall, And if one green bottle should accidentally fall, There'll be nine green bottles hanging on the wall. Nine green bottles ha...
5,539
Move every letter in the provided string forward 10 letters through the alphabet. If it goes past 'z', start again at 'a'. Input will be a string with length > 0.
5,540
### Task Write a function that receives a non-negative integer `n ( n >= 0 )` and returns the next higher multiple of five of that number, obtained by concatenating the ***shortest possible*** binary string to the end of this number's binary representation. ### Examples ```python 1. next_multiple_of_five(8) ``` ```...
5,541
Given a 2D array and a number of generations, compute n timesteps of [Conway's Game of Life](http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life). The rules of the game are: 1. Any live cell with fewer than two live neighbours dies, as if caused by underpopulation. 2. Any live cell with more than three live neighbou...
5,542
Two moving objects A and B are moving accross the same orbit (those can be anything: two planets, two satellites, two spaceships,two flying saucers, or spiderman with batman if you prefer). If the two objects start to move from the same point and the orbit is circular, write a function that gives the time the two objec...
5,543
Your retro heavy metal band, VÄxën, originally started as kind of a joke, just because why would anyone want to use the crappy foosball table in your startup's game room when they could be rocking out at top volume in there instead? Yes, a joke, but now all the top tech companies are paying you top dollar to play at th...
5,544
Write a function that returns the index of the first occurence of the word "Wally". "Wally" must not be part of another word, but it can be directly followed by a punctuation mark. If no such "Wally" exists, return -1. Examples: "Wally" => 0 "Where's Wally" => 8 "Where's Waldo" => -1 "DWally Wallyd .Wally" => -...
5,545
# Definition **_Jumping number_** is the number that *All adjacent digits in it differ by 1*. ____ # Task **_Given_** a number, **_Find if it is Jumping or not_** . ____ # Warm-up (Highly recommended) # [Playing With Numbers Series](https://www.codewars.com/collections/playing-with-numbers) ___ # Notes * **_N...
5,546
<strong>Task</strong> Find the volume of the largest cube that will fit inside a cylinder of given height <code>h</code> and radius <code>r</code>. Don't round your result. The result needs to be within <code>0.01</code> error margin of the expected result. HINT: There are two cases to consider. Will it be the cylin...
5,547
There are `N` lights in the room indexed from `0` to `N-1`. All the lights are currently off, and you want to turn them on. At this point, you find that there are `M` switches in the room, indexed from `0` to `M-1`. Each switch corresponds to several lights. Once the switch is toggled, all the lights related to the swi...
5,548
In Russia, there is an army-purposed station named UVB-76 or "Buzzer" (see also https://en.wikipedia.org/wiki/UVB-76). Most of time specific "buzz" noise is being broadcasted, but on very rare occasions, the buzzer signal is interrupted and a voice transmission in Russian takes place. Transmitted messages have always t...
5,549
Texas Hold'em is a Poker variant in which each player is given two "hole cards". Players then proceed to make a series of bets while five "community cards" are dealt. If there are more than one player remaining when the betting stops, a showdown takes place in which players reveal their cards. Each player makes the bes...
5,550
More difficult version: [Kingdoms Ep2: The curse (normal)](https://www.codewars.com/kata/615b636c3f8bcf0038ae8e8b) Our King was cursed - He can not pronounce an entire word anymore. Looking for the witch, the inquisition punishes every beautiful and intelligent woman in the Kingdom. Trying to save your wife and to sto...
5,551
# Task After becoming famous, CodeBots decided to move to a new building and live together. The building is represented by a rectangular matrix of rooms, each cell containing an integer - the price of the room. Some rooms are free (their cost is 0), but that's probably because they are haunted, so all the bots are afr...
5,552
This kata aims to show the vulnerabilities of hashing functions for short messages. When provided with a SHA-256 hash, return the value that was hashed. You are also given the characters that make the expected value, but in alphabetical order. The returned value is less than 10 characters long. Return `nil` for Ruby ...
5,553
Create a `Vector` class with `x` and a `y` attributes that represent component magnitudes in the x and y directions. Your vectors should handle vector additon with an `.add()` method that takes a second vector as an argument and returns a new vector equal to the sum of the vector you call `.add()` on and the vector yo...
5,554
## Task Description You're re-designing a blog, and the blog's posts have the `Weekday Month Day, time` format for showing the date and time when a post was made, e.g., `Friday May 2, 7pm`. You're running out of screen real estate, and on some pages you want to display a shorter format, `Weekday Month Day` that omits...
5,555
For an integer ```k``` rearrange all the elements of the given array in such way, that: all elements that are less than ```k``` are placed before elements that are not less than ```k```;<br> all elements that are less than ```k``` remain in the same order with respect to each other;<br> all elements that are not less ...
5,556
<div style="width: 100%; margin: 16px 0; border-top: 1px solid grey;" /> - If you like cryptography and playing cards, have also a look at [Card-Chameleon, a Cipher with Playing cards](https://www.codewars.com/kata/59c2ff946bddd2a2fd00009e). - And if you just like playing cards, have a look at [Playing Cards Draw Orde...
5,557
From a sentence, deduce the total number of animals. For example : "I see 3 zebras, 5 lions and 6 giraffes." The answer must be 14 "Mom, 3 rhinoceros and 6 snakes come to us!" The answer must be 9
5,558
<div style='float: right; width: 180px; padding-left: 20px'> ![Alice](http://i.imgur.com/KuY6dIV.png "Foxy Alice")</div> ## Story Bob is sailing on his boat. The weather is very stormy and gloomy. Bob calls Alice. After some talk, Alice and Bob play a game on the phone. Alice has a piece of paper with coordinate...
5,559
As the title suggests, this is the hard-core version of <a href="https://www.codewars.com/kata/sum-of-a-sequence/" target="_blank"> another neat kata</a>. The task is simple to explain: simply sum all the numbers from the first parameter being the beginning to the second parameter being the upper limit (possibly inclu...
5,560
# Task You are given two strings s and t of the same length, consisting of uppercase English letters. Your task is to find the minimum number of "replacement operations" needed to get some `anagram` of the string t from the string s. A replacement operation is performed by picking exactly one character from the string...
5,561
In this kata you must implement the "fizz buzz reloaded function". This function takes the following arguments: * start (integer >= 0). -> this is the point where we start counting (inclusive). * stop (integer >= 1) -> this is the point where we stop counting (inclusive). * step (integer) if step is positive count for...
5,562
A rectangle is can be defined by two factors: height and width. Its area is defined as the multiplication of the two: height * width. Its perimeter is the sum of its four edges: height + height + width + width. It is possible to create rectangles of the same area but different perimeters. For example, given an area ...
5,563
Create a simple calculator that given a string of operators (), +, -, *, / and numbers separated by spaces returns the value of that expression Example: ```python Calculator().evaluate("2 / 2 + 3 * 4 - 6") # => 7 ``` ```ruby Calculator.new.evaluate("2 / 2 + 3 * 4 - 6") # => 7 ``` ```java Calculator.evaluate("2 / 2 + ...
5,564
Get the list of integers for Codewars Leaderboard score (aka Honor) in descending order ``` Note: if it was the bad timing, the data could be updated during your test cases. Try several times if you had such experience. ```
5,565
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 to count will be positive numbers greater than `0`. Return the results as an array or list ( depending on language ). ### Examples ```cpp countBy(1,10) should ret...
5,566
For a pole vaulter, it is very important to begin the approach run at the best possible starting mark. This is affected by numerous factors and requires fine-tuning in practice. But there is a guideline that will help a beginning vaulter start at approximately the right location for the so-called "three-step approach,"...
5,567
A simple kata, my first. simply tranform an array into a string, like so: ```javascript transform([4, -56, true, "box"]) => "4-56truebox" ``` ```haskell transform [ 5, 7, 8, 9, 0, 5 ] -> "578905" ``` have fun coding!
5,568
Complete the function/method so that it takes a `PascalCase` string and returns the string in `snake_case` notation. Lowercase characters can be numbers. If the method gets a number as input, it should return a string. ## Examples ``` "TestController" --> "test_controller" "MoviesAndBooks" --> "movies_and_books" "...
5,569
You're laying out a rad pixel art mural to paint on your living room wall in homage to [Paul Robertson](http://68.media.tumblr.com/0f55f7f3789a354cfcda7c2a64f501d1/tumblr_o7eq3biK9s1qhccbco1_500.png), your favorite pixel artist. You want your work to be perfect down to the millimeter. You haven't decided on the dimens...
5,570
The number `1035` is the smallest integer that exhibits a non frequent property: one its multiples, `3105 = 1035 * 3`, has its same digits but in different order, in other words, `3105`, is one of the permutations of `1035`. The number `125874` is the first integer that has this property when the multiplier is `2`, th...
5,571
# Summation Of Primes The sum of the primes below or equal to 10 is **2 + 3 + 5 + 7 = 17**. Find the sum of all the primes **_below or equal to the number passed in_**. From Project Euler's [Problem #10](https://projecteuler.net/problem=10 "Project Euler - Problem 10").
5,572
In recreational mathematics, a [Keith number](https://en.wikipedia.org/wiki/Keith_number) or repfigit number (short for repetitive Fibonacci-like digit) is a number in the following integer sequence: `14, 19, 28, 47, 61, 75, 197, 742, 1104, 1537, 2208, 2580, 3684, 4788, 7385, 7647, 7909, ...` (sequence A007629 in the ...
5,573
Evaluate the given string with the given conditons. The conditions will be passed in an array and will be formatted like this: ``` {symbol or digit}{comparison operator}{symbol or digit} ``` Return the results in an array. The characters in the conditions will always be in the string. Characters in the string are ch...
5,574
### **[Mahjong Series](/collections/mahjong)** **Mahjong** is based on draw-and-discard card games that were popular in 18th and 19th century China and some are still popular today. In each deck, there are three different suits numbered `1` to `9`, which are called **Simple tiles**. To simplify the problem, we talk a...
5,575
Inspired by another Kata - <a href="http://www.codewars.com/kata/heroes-of-might-and-magic-ii-chain-lightning">Heroes of Might & Magic II: Chain Lightning</a> by Firefly2002, I thought I might have a go at another Kata related to this game. ___ In this Kata, two groups of monsters will attack each other, and your job...
5,576
A happy number is a number defined by the following process: starting with any positive integer, replace the number by the sum of the squares of its digits, and repeat the process until the number equals 1 (where it will stay), or it loops endlessly in a cycle which does not include 1. Those numbers for which this pro...
5,577
Consider having a cow that gives a child every year from her fourth year of life on and all her subsequent children do the same. After n years how many cows will you have? | After n years | Cow count | | - | - | | 0 | 1 | | 1 | 1 | | 3 | 2 | | 4 | 3 | | 10 | 28 | Return null if n is not an integer. Note: Assume all...
5,578
The accounts of the "Fat to Fit Club (FFC)" association are supervised by John as a volunteered accountant. The association is funded through financial donations from generous benefactors. John has a list of the first `n` donations: `[14, 30, 5, 7, 9, 11, 15]` He wants to know how much the next benefactor should give t...
5,579
In mathematics, the factorial of a non-negative integer n, denoted by n!, is the product of all positive integers less than or equal to n. For example: 5! = 5 \* 4 \* 3 \* 2 \* 1 = 120. By convention the value of 0! is 1. ~~~if-not:factor Write a function to calculate factorial for a given input. If input is below 0 o...
5,580
For all x in the range of integers [0, 2 ** n), let y[x] be the binary exclusive-or of x and x // 2. Find the sum of all numbers in y. Write a function sum_them that, given n, will return the value of the above sum. This can be implemented a simple loop as shown in the initial code. But once n starts getting to highe...
5,581
You are making your very own boardgame. The game is played by two opposing players, featuring a 6 x 6 tile system, with the players taking turns to move their pieces (similar to chess). The design is finished, now it's time to actually write and implement the features. Being the good programmer you are, you carefully p...
5,582
## 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...
5,583
#### The following task has two parts. First you must figure out the principle behind the following encoding of natural numbers. The table below displays the encoding of the numbers from 0 to 11. **Number** -------> **Code** * `0 -------> '.'` * `1 -------> '()'` * `2 -------> '(())'` * `3 -------> '(.())'` * `4 -...
5,584
*Inspired by https://www.youtube.com/watch?v=eW_bMqcJXv0/* You are speedrunning a game with `N` successive levels. For each level `i = 1,...,N`, you have a target time `t_i` based on the "strats" you're going for, and a success probability `p_i` of achieving the respective target time (i.e., pulling off the strats). ...
5,585
A palindrome is a word, phrase, number, or other sequence of characters which reads the same backward as forward. Examples of numerical palindromes are: 2332 <br>110011 <br>54322345 For a given number ```num```, write a function which returns the number of numerical palindromes within each number. For this kata, sin...
5,586
<h2>Story:</h2> Alex is a great fan of Snooker and he likes recording the results of his favorite players by recording the balls that fall into the pockets of the table. He asks you to help him with a program that calculates the points a player scored in a given set using his notes. Unfortunatly his notes are quiet a ...
5,587
*This kata is based on [Project Euler Problem 539](https://projecteuler.net/problem=539)* ## Object Find the last number between 1 and `n` (inclusive) that survives the elimination process #### How It Works Start with the first number on the left then remove every other number moving right until you reach the the e...
5,588
## What is an ASCII Art? ASCII Art is art made of basic letters and symbols found in the ascii character set. ### Example of ASCII Art (by Joan Stark) ``` _ _ / _ (')-=-(') __|_ {_} __( " )__ |____| ...
5,589
Write a function `titleToNumber(title) or title_to_number(title) or titleToNb title ...` (depending on the language) that given a column title as it appears in an Excel sheet, returns its corresponding column number. All column titles will be uppercase. Examples: ``` titleTonumber('A') === 1 titleTonumber('Z') ===...
5,590
# Exclusive "or" (xor) Logical Operator ## Overview In some scripting languages like PHP, there exists a logical operator (e.g. `&&`, `||`, `and`, `or`, etc.) called the "Exclusive Or" (hence the name of this Kata). The exclusive or evaluates two booleans. It then returns `true` if **exactly one of the two expressi...
5,591
You're playing to scrabble. But counting points is hard. You decide to create a little script to calculate the best possible value. The function takes two arguments :<br/> <ol> <li>`points` : an array of integer representing for each letters from A to Z the points that it pays</li> <li>`words` : an array of stri...
5,592
The eight queens puzzle is the problem of placing eight chess queens on an 8×8 chessboard so that no two queens threaten each other. Thus, a solution requires that no two queens share the same row, column or diagonal. The eight queens puzzle is an example of the more general N queens problem of placing N non-attacking ...
5,593
## Your Story "A *piano* in the home meant something." - *Fried Green Tomatoes at the Whistle Stop Cafe* You've just realized a childhood dream by getting a beautiful and beautiful-sounding upright piano from a friend who was leaving the country. You immediately started doing things like playing "<a href="https://en.w...
5,594
<img src="https://media.giphy.com/media/13AN8X7jBIm15m/giphy.gif" style="width:463px;height:200px;"> Every budding hacker needs an alias! `The Phantom Phreak`, `Acid Burn`, `Zero Cool` and `Crash Override` are some notable examples from the film `Hackers`. Your task is to create a function that, given a proper first ...
5,595
<h2>Digit Recovery</h2> Some letters in the input string are representing a written-out digit. Some of the letters may randomly shuffled. Your task is to recover them all. Note that: <ul> <li> Only consecutive letters can be used. "OTNE" cannot be recovered to 1! <li> Every letter has to start with an increasing inde...
5,596
# Grains Write a program that calculates the number of grains of wheat on a specific square of chessboard given that the number on each square is double the previous one. There are 64 squares on a chessboard. #Example: square(1) = 1 square(2) = 2 square(3) = 4 square(4) = 8 etc... Write a program that shows how man...
5,597
## Description We have a big list of jobs to do, and all of the jobs have been assigned a difficulty rating. Difficulties will be an integer, and they may be positive, negative or zero. Jim and Bob have the job of doing all the jobs, but we need to find the position in the container where we can make a cut so that J...
5,598
Complete the function which converts hex number (given as a string) to a decimal number.
5,599