task
stringlengths
0
154k
__index_level_0__
int64
0
39.2k
Title: String Mark Time Limit: None seconds Memory Limit: None megabytes Problem Description: At the Byteland State University marks are strings of the same length. Mark *x* is considered better than *y* if string *y* is lexicographically smaller than *x*. Recently at the BSU was an important test work on which Vas...
5,300
Title: The Meeting Place Cannot Be Changed Time Limit: None seconds Memory Limit: None megabytes Problem Description: The main road in Bytecity is a straight line from south to north. Conveniently, there are coordinates measured in meters from the southernmost building in north direction. At some points on the road...
5,301
Title: Ciel and Gondolas Time Limit: None seconds Memory Limit: None megabytes Problem Description: Fox Ciel is in the Amusement Park. And now she is in a queue in front of the Ferris wheel. There are *n* people (or foxes more precisely) in the queue: we use first people to refer one at the head of the queue, and *n...
5,302
Title: Fight the Monster Time Limit: None seconds Memory Limit: None megabytes Problem Description: A monster is attacking the Cyberland! Master Yang, a braver, is going to beat the monster. Yang and the monster each have 3 attributes: hitpoints (*HP*), offensive power (*ATK*) and defensive power (*DEF*). During t...
5,303
Title: Changing a String Time Limit: 2 seconds Memory Limit: 256 megabytes Problem Description: There is a string *s*, consisting of capital Latin letters. Let's denote its current length as |*s*|. During one move it is allowed to apply one of the following operations to it: - INSERT *pos* *ch* β€” insert a letter ...
5,304
Title: Start Up Time Limit: None seconds Memory Limit: None megabytes Problem Description: Recently, a start up by two students of a state university of city F gained incredible popularity. Now it's time to start a new company. But what do we call it? The market analysts came up with a very smart plan: the name of ...
5,305
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Rick and Morty want to find MR. PBH and they can't do it alone. So they need of Mr. Meeseeks. They Have generated *n* Mr. Meeseeks, standing in a line numbered from 1 to *n*. Each of them has his own color. *i*-th Mr. Meeseeks' co...
5,306
Title: Long number Time Limit: None seconds Memory Limit: None megabytes Problem Description: Consider the following grammar: - <expression> ::= <term> | <expression> '+' <term>- <term> ::= <number> | <number> '-' <number> | <number> '(' <expression> ')'-...
5,307
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Dima's got a staircase that consists of *n* stairs. The first stair is at height *a*1, the second one is at *a*2, the last one is at *a**n* (1<=≀<=*a*1<=≀<=*a*2<=≀<=...<=≀<=*a**n*). Dima decided to play with the staircase, so he...
5,308
Title: Optical Experiment Time Limit: 5 seconds Memory Limit: 256 megabytes Problem Description: Professor Phunsuk Wangdu has performed some experiments on rays. The setup for *n* rays is as follows. There is a rectangular box having exactly *n* holes on the opposite faces. All rays enter from the holes of the firs...
5,309
Title: Game of Credit Cards Time Limit: None seconds Memory Limit: None megabytes Problem Description: After the fourth season Sherlock and Moriary have realized the whole foolishness of the battle between them and decided to continue their competitions in peaceful game of Credit Cards. Rules of this game are simpl...
5,310
Title: Don't Exceed Time Limit: None seconds Memory Limit: None megabytes Problem Description: You generate real numbers *s*1,<=*s*2,<=...,<=*s**n* as follows: - *s*0<==<=0; - *s**i*<==<=*s**i*<=-<=1<=+<=*t**i*, where *t**i* is a real number chosen independently uniformly at random between 0 and 1, inclusive. Y...
5,311
Title: Train and Peter Time Limit: 1 seconds Memory Limit: 64 megabytes Problem Description: Peter likes to travel by train. He likes it so much that on the train he falls asleep. Once in summer Peter was going by train from city A to city B, and as usual, was sleeping. Then he woke up, started to look through the...
5,312
Title: Fire in the City Time Limit: None seconds Memory Limit: None megabytes Problem Description: The capital of Berland looks like a rectangle of size *n*<=Γ—<=*m* of the square blocks of same size. Fire! It is known that *k*<=+<=1 blocks got caught on fire (*k*<=+<=1<=≀<=*n*Β·*m*). Those blocks are centers of ign...
5,313
Title: Proper Nutrition Time Limit: None seconds Memory Limit: None megabytes Problem Description: Vasya has *n* burles. One bottle of Ber-Cola costs *a* burles and one Bars bar costs *b* burles. He can buy any non-negative integer number of bottles of Ber-Cola and any non-negative integer number of Bars bars. Find...
5,314
Title: Barnicle Time Limit: None seconds Memory Limit: None megabytes Problem Description: Barney is standing in a bar and starring at a pretty girl. He wants to shoot her with his heart arrow but he needs to know the distance between him and the girl to make his shot accurate. Barney asked the bar tender Carl abou...
5,315
Title: The Great Mixing Time Limit: None seconds Memory Limit: None megabytes Problem Description: Sasha and Kolya decided to get drunk with Coke, again. This time they have *k* types of Coke. *i*-th type is characterised by its carbon dioxide concentration . Today, on the party in honour of Sergiy of Vancouver they...
5,316
Title: Kyoya and Train Time Limit: None seconds Memory Limit: None megabytes Problem Description: Kyoya Ootori wants to take the train to get to school. There are *n* train stations and *m* one-way train lines going between various stations. Kyoya is currently at train station 1, and the school is at station *n*. To...
5,317
Title: Persistent Bookcase Time Limit: None seconds Memory Limit: None megabytes Problem Description: Recently in school Alina has learned what are the persistent data structures: they are data structures that always preserves the previous version of itself and access to it when it is modified. After reaching home...
5,318
Title: Minesweeper 1D Time Limit: None seconds Memory Limit: None megabytes Problem Description: Game "Minesweeper 1D" is played on a line of squares, the line's height is 1 square, the line's width is *n* squares. Some of the squares contain bombs. If a square doesn't contain a bomb, then it contains a number from ...
5,319
Title: Paths Time Limit: None seconds Memory Limit: None megabytes Problem Description: You are given a positive integer *n*. Let's build a graph on vertices 1,<=2,<=...,<=*n* in such a way that there is an edge between vertices *u* and *v* if and only if . Let *d*(*u*,<=*v*) be the shortest distance between *u* and...
5,320
Title: Merge Equals Time Limit: None seconds Memory Limit: None megabytes Problem Description: You are given an array of positive integers. While there are at least two equal elements, we will perform the following operation. We choose the smallest value $x$ that occurs in the array $2$ or more times. Take the first...
5,321
Title: Mausoleum Time Limit: None seconds Memory Limit: None megabytes Problem Description: King of Berland Berl IV has recently died. Hail Berl V! As a sign of the highest achievements of the deceased king the new king decided to build a mausoleum with Berl IV's body on the main square of the capital. The mausoleu...
5,322
Title: Dreamoon and Sums Time Limit: None seconds Memory Limit: None megabytes Problem Description: Dreamoon loves summing up something for no reason. One day he obtains two integers *a* and *b* occasionally. He wants to calculate the sum of all nice integers. Positive integer *x* is called nice if and , where *k* ...
5,323
Title: Nicholas and Permutation Time Limit: None seconds Memory Limit: None megabytes Problem Description: Nicholas has an array *a* that contains *n* distinct integers from 1 to *n*. In other words, Nicholas has a permutation of size *n*. Nicholas want the minimum element (integer 1) and the maximum element (integ...
5,324
Title: Tanks Time Limit: None seconds Memory Limit: None megabytes Problem Description: Petya sometimes has to water his field. To water the field, Petya needs a tank with exactly *V* ml of water. Petya has got *N* tanks, *i*-th of them initially containing *a**i* ml of water. The tanks are really large, any of the...
5,325
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Recently, a wild Krakozyabra appeared at Jelly Castle. It is, truth to be said, always eager to have something for dinner. Its favorite meal is natural numbers (typically served with honey sauce), or, to be more precise, the zero...
5,326
Title: Phone Numbers Time Limit: None seconds Memory Limit: None megabytes Problem Description: Vasya has several phone books, in which he recorded the telephone numbers of his friends. Each of his friends can have one or several phone numbers. Vasya decided to organize information about the phone numbers of friend...
5,327
Title: Brackets in Implications Time Limit: None seconds Memory Limit: None megabytes Problem Description: Implication is a function of two logical arguments, its value is false if and only if the value of the first argument is true and the value of the second argument is false. Implication is written by using cha...
5,328
Title: Cormen --- The Best Friend Of a Man Time Limit: None seconds Memory Limit: None megabytes Problem Description: Recently a dog was bought for Polycarp. The dog's name is Cormen. Now Polycarp has a lot of troubles. For example, Cormen likes going for a walk. Empirically Polycarp learned that the dog needs at ...
5,329
Title: Prime Permutation Time Limit: None seconds Memory Limit: None megabytes Problem Description: You are given a string *s*, consisting of small Latin letters. Let's denote the length of the string as |*s*|. The characters in the string are numbered starting from 1. Your task is to find out if it is possible to...
5,330
Title: DNA Alignment Time Limit: None seconds Memory Limit: None megabytes Problem Description: Vasya became interested in bioinformatics. He's going to write an article about similar cyclic DNA sequences, so he invented a new method for determining the similarity of cyclic sequences. Let's assume that strings *s* ...
5,331
Title: Sereja and Contest Time Limit: None seconds Memory Limit: None megabytes Problem Description: During the last Sereja's Codesecrof round the server crashed many times, so the round was decided to be made unrated for some participants. Let's assume that *n* people took part in the contest. Let's assume that t...
5,332
Title: Bots Time Limit: None seconds Memory Limit: None megabytes Problem Description: Sasha and Ira are two best friends. But they aren’t just friends, they are software engineers and experts in artificial intelligence. They are developing an algorithm for two bots playing a two-player game. The game is cooperative...
5,333
Title: Army Time Limit: 2 seconds Memory Limit: 256 megabytes Problem Description: The Berland Armed Forces System consists of *n* ranks that are numbered using natural numbers from 1 to *n*, where 1 is the lowest rank and *n* is the highest rank. One needs exactly *d**i* years to rise from rank *i* to rank *i*<=+<...
5,334
Title: Searching for Graph Time Limit: None seconds Memory Limit: None megabytes Problem Description: Let's call an undirected graph of *n* vertices *p*-interesting, if the following conditions fulfill: - the graph contains exactly 2*n*<=+<=*p* edges; - the graph doesn't contain self-loops and multiple edges; - ...
5,335
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: There are two decks of cards lying on the table in front of you, some cards in these decks lay face up, some of them lay face down. You want to merge them into one deck in which each card is face down. You're going to do it in two...
5,336
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Indiana Jones found ancient Aztec catacombs containing a golden idol. The catacombs consists of $n$ caves. Each pair of caves is connected with a two-way corridor that can be opened or closed. The entrance to the catacombs is in t...
5,337
Title: Washer, Dryer, Folder Time Limit: None seconds Memory Limit: None megabytes Problem Description: You have *k* pieces of laundry, each of which you want to wash, dry and fold. You are at a laundromat that has *n*1 washing machines, *n*2 drying machines and *n*3 folding machines. Each machine can process only o...
5,338
Title: Riding in a Lift Time Limit: None seconds Memory Limit: None megabytes Problem Description: Imagine that you are in a building that has exactly *n* floors. You can move between the floors in a lift. Let's number the floors from bottom to top with integers from 1 to *n*. Now you're on the floor number *a*. You...
5,339
Title: Roadside Trees (Simplified Edition) Time Limit: None seconds Memory Limit: None megabytes Problem Description: Squirrel Liss loves nuts. There are *n* trees (numbered 1 to *n* from west to east) along a street and there is a delicious nut on the top of each tree. The height of the tree *i* is *h**i*. Liss wan...
5,340
Title: Socks Time Limit: None seconds Memory Limit: None megabytes Problem Description: Arseniy is already grown-up and independent. His mother decided to leave him alone for *m* days and left on a vacation. She have prepared a lot of food, left some money and washed all Arseniy's clothes. Ten minutes before her l...
5,341
Title: Flag of Berland Time Limit: None seconds Memory Limit: None megabytes Problem Description: The flag of Berland is such rectangular field *n*<=Γ—<=*m* that satisfies following conditions: - Flag consists of three colors which correspond to letters 'R', 'G' and 'B'. - Flag consists of three equal in width and...
5,342
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: One day *n* friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other *n*<=-<=1 people take part in the game. For each person we know in how many rounds he wants to be a ...
5,343
Title: Maximal Area Quadrilateral Time Limit: None seconds Memory Limit: None megabytes Problem Description: Iahub has drawn a set of *n* points in the cartesian plane which he calls "special points". A quadrilateral is a simple polygon without self-intersections with four sides (also called edges) and four vertices...
5,344
Title: Slalom Time Limit: None seconds Memory Limit: None megabytes Problem Description: Little girl Masha likes winter sports, today she's planning to take part in slalom skiing. The track is represented as a grid composed of *n*<=Γ—<=*m* squares. There are rectangular obstacles at the track, composed of grid squar...
5,345
Title: Nastya and an Array Time Limit: None seconds Memory Limit: None megabytes Problem Description: Nastya owns too many arrays now, so she wants to delete the least important of them. However, she discovered that this array is magic! Nastya now knows that the array has the following properties: - In one second ...
5,346
Title: Three Logos Time Limit: None seconds Memory Limit: None megabytes Problem Description: Three companies decided to order a billboard with pictures of their logos. A billboard is a big square board. A logo of each company is a rectangle of a non-zero area. Advertisers will put up the ad only if it is possible...
5,347
Title: Team Time Limit: None seconds Memory Limit: None megabytes Problem Description: Now it's time of Olympiads. Vanya and Egor decided to make his own team to take part in a programming Olympiad. They've been best friends ever since primary school and hopefully, that can somehow help them in teamwork. For each t...
5,348
Title: Save Luke Time Limit: None seconds Memory Limit: None megabytes Problem Description: Luke Skywalker got locked up in a rubbish shredder between two presses. R2D2 is already working on his rescue, but Luke needs to stay alive as long as possible. For simplicity we will assume that everything happens on a strai...
5,349
Title: Points on Plane Time Limit: None seconds Memory Limit: None megabytes Problem Description: On a plane are *n* points (*x**i*, *y**i*) with integer coordinates between 0 and 106. The distance between the two points with numbers *a* and *b* is said to be the following value: (the distance calculated by such fo...
5,350
Title: Repaintings Time Limit: 2 seconds Memory Limit: 256 megabytes Problem Description: A chessboard *n*<=Γ—<=*m* in size is given. During the zero minute we repaint all the black squares to the 0 color. During the *i*-th minute we repaint to the *i* color the initially black squares that have exactly four corner-a...
5,351
Title: Collisions Time Limit: 2 seconds Memory Limit: 256 megabytes Problem Description: On a number line there are *n* balls. At time moment 0 for each ball the following data is known: its coordinate *x**i*, speed *v**i* (possibly, negative) and weight *m**i*. The radius of the balls can be ignored. The balls col...
5,352
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Programmer Vasya is studying a new programming language &amp;K*. The &amp;K* language resembles the languages of the C family in its syntax. However, it is more powerful, which is why the rules of the actual C-like languages are u...
5,353
Title: Text Messaging Time Limit: 1 seconds Memory Limit: 256 megabytes Problem Description: Fangy the little walrus, as all the modern walruses, loves to communicate via text messaging. One day he faced the following problem: When he sends large texts, they are split into parts each containing *n* characters (which...
5,354
Title: Vanya and Lanterns Time Limit: None seconds Memory Limit: None megabytes Problem Description: Vanya walks late at night along a straight street of length *l*, lit by *n* lanterns. Consider the coordinate system with the beginning of the street corresponding to the point 0, and its end corresponding to the poi...
5,355
Title: Hyperspace Jump (easy) Time Limit: None seconds Memory Limit: None megabytes Problem Description: The Rebel fleet is on the run. It consists of *m* ships currently gathered around a single planet. Just a few seconds ago, the vastly more powerful Empire fleet has appeared in the same solar system, and the Rebe...
5,356
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Valentin participates in a show called "Shockers". The rules are quite easy: jury selects one letter which Valentin doesn't know. He should make a small speech, but every time he pronounces a word that contains the selected letter...
5,357
Title: Two-Paths Time Limit: None seconds Memory Limit: None megabytes Problem Description: You are given a weighted tree (undirected connected graph with no cycles, loops or multiple edges) with $n$ vertices. The edge $\{u_j, v_j\}$ has weight $w_j$. Also each vertex $i$ has its own value $a_i$ assigned to it. Let...
5,358
Title: Multi-core Processor Time Limit: None seconds Memory Limit: None megabytes Problem Description: The research center Q has developed a new multi-core processor. The processor consists of *n* cores and has *k* cells of cache memory. Consider the work of this processor. At each cycle each core of the processor ...
5,359
Title: Restore a Number Time Limit: None seconds Memory Limit: None megabytes Problem Description: Vasya decided to pass a very large integer *n* to Kate. First, he wrote that number as a string, then he appended to the right integer *k*Β β€” the number of digits in *n*. Magically, all the numbers were shuffled in ar...
5,360
Title: Logical Expression Time Limit: None seconds Memory Limit: None megabytes Problem Description: You are given a boolean function of three variables which is defined by its truth table. You need to find an expression of minimum length that equals to this function. The expression may consist of: - Operation AN...
5,361
Title: Covered Points Count Time Limit: None seconds Memory Limit: None megabytes Problem Description: You are given $n$ segments on a coordinate line; each endpoint of every segment has integer coordinates. Some segments can degenerate to points. Segments can intersect with each other, be nested in each other or ev...
5,362
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: Famous Brazil city Rio de Janeiro holds a tennis tournament and Ostap Bender doesn't want to miss this event. There will be *n* players participating, and the tournament will follow knockout rules from the very first game. That me...
5,363
Title: Maximum Number Time Limit: None seconds Memory Limit: None megabytes Problem Description: Stepan has the newest electronic device with a display. Different digits can be shown on it. Each digit is shown on a seven-section indicator like it is shown on the picture below. So, for example, to show the digit 3 o...
5,364
Title: Intercepted Message Time Limit: None seconds Memory Limit: None megabytes Problem Description: Hacker Zhorik wants to decipher two secret messages he intercepted yesterday. Yeah message is a sequence of encrypted blocks, each of them consists of several bytes of information. Zhorik knows that each of the mes...
5,365
Title: Treasure Time Limit: None seconds Memory Limit: None megabytes Problem Description: Malek has recently found a treasure map. While he was looking for a treasure he found a locked door. There was a string *s* written on the door consisting of characters '(', ')' and '#'. Below there was a manual on how to open...
5,366
Title: Collective Mindsets (easy) Time Limit: None seconds Memory Limit: None megabytes Problem Description: Tonight is brain dinner night and all zombies will gather together to scarf down some delicious brains. The artful Heidi plans to crash the party, incognito, disguised as one of them. Her objective is to get ...
5,367
Title: Generate a String Time Limit: None seconds Memory Limit: None megabytes Problem Description: zscoder wants to generate an input file for some programming competition problem. His input is a string consisting of *n* letters 'a'. He is too lazy to write a generator so he will manually generate the input in a t...
5,368
Title: Fibonacci-ish Time Limit: None seconds Memory Limit: None megabytes Problem Description: Yash has recently learnt about the Fibonacci sequence and is very excited about it. He calls a sequence Fibonacci-ish if 1. the sequence consists of at least two elements 1. *f*0 and *f*1 are arbitrary 1. *f**n*<=+<=...
5,369
Title: Jeff and Furik Time Limit: None seconds Memory Limit: None megabytes Problem Description: Jeff has become friends with Furik. Now these two are going to play one quite amusing game. At the beginning of the game Jeff takes a piece of paper and writes down a permutation consisting of *n* numbers: *p*1, *p*2, ....
5,370
Title: Paper Work Time Limit: None seconds Memory Limit: None megabytes Problem Description: Polycarpus has been working in the analytic department of the "F.R.A.U.D." company for as much as *n* days. Right now his task is to make a series of reports about the company's performance for the last *n* days. We know tha...
5,371
Title: The number on the board Time Limit: None seconds Memory Limit: None megabytes Problem Description: Some natural number was written on the board. Its sum of digits was not less than *k*. But you were distracted a bit, and someone changed this number to *n*, replacing some digits with others. It's known that th...
5,372
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: In a small but very proud high school it was decided to win ACM ICPC. This goal requires to compose as many teams of three as possible, but since there were only 6 students who wished to participate, the decision was to build exac...
5,373
Title: Ladder Time Limit: None seconds Memory Limit: None megabytes Problem Description: You've got an array, consisting of *n* integers *a*1,<=*a*2,<=...,<=*a**n*. Also, you've got *m* queries, the *i*-th query is described by two integers *l**i*,<=*r**i*. Numbers *l**i*,<=*r**i* define a subsegment of the original...
5,374
Title: Juicer Time Limit: None seconds Memory Limit: None megabytes Problem Description: Kolya is going to make fresh orange juice. He has *n* oranges of sizes *a*1,<=*a*2,<=...,<=*a**n*. Kolya will put them in the juicer in the fixed order, starting with orange of size *a*1, then orange of size *a*2 and so on. To b...
5,375
Title: Geometric Progressions Time Limit: None seconds Memory Limit: None megabytes Problem Description: Geometric progression with the first element *a* and common ratio *b* is a sequence of numbers *a*,<=*ab*,<=*ab*2,<=*ab*3,<=.... You are given *n* integer geometric progressions. Your task is to find the smalles...
5,376
Title: A rectangle Time Limit: None seconds Memory Limit: None megabytes Problem Description: Developing tools for creation of locations maps for turn-based fights in a new game, Petya faced the following problem. A field map consists of hexagonal cells. Since locations sizes are going to be big, a game designer wa...
5,377
Title: Search for Pretty Integers Time Limit: None seconds Memory Limit: None megabytes Problem Description: You are given two lists of non-zero digits. Let's call an integer pretty if its (base 10) representation has at least one digit from the first list and at least one digit from the second list. What is the sm...
5,378
Title: Present for Vitalik the Philatelist Time Limit: None seconds Memory Limit: None megabytes Problem Description: Vitalik the philatelist has a birthday today! As he is a regular customer in a stamp store called 'Robin Bobin', the store management decided to make him a gift. Vitalik wants to buy one stamp and...
5,379
Title: none Time Limit: None seconds Memory Limit: None megabytes Problem Description: The Tower of Hanoi is a well-known mathematical puzzle. It consists of three rods, and a number of disks of different sizes which can slide onto any rod. The puzzle starts with the disks in a neat stack in ascending order of size ...
5,380
Title: Raffles Time Limit: None seconds Memory Limit: None megabytes Problem Description: Johnny is at a carnival which has *n* raffles. Raffle *i* has a prize with value *p**i*. Each participant can put tickets in whichever raffles they choose (they may have more than one ticket in a single raffle). At the end of t...
5,381
Title: Mirror Box Time Limit: None seconds Memory Limit: None megabytes Problem Description: Mirror Box is a name of a popular game in the Iranian National Amusement Park (INAP). There is a wooden box, 105 cm long and 100 cm high in this game. Some parts of the box's ceiling and floor are covered by mirrors. There a...
5,382
Title: Little Xor Time Limit: None seconds Memory Limit: None megabytes Problem Description: Little Petya likes arrays that consist of non-negative integers a lot. Recently his mom has presented him one such array consisting of *n* elements. Petya immediately decided to find there a segment of consecutive elements, ...
5,383
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, rearrange the digits to create the highest possible number. ### Examples: Input: `42145` Output: `54421` Input: `145263` Output: `654321` Input: `123456789` Output: ...
5,384
Your task is to remove all **consecutive duplicate** words from a string, leaving only first words entries. For example: ``` "alpha beta beta gamma gamma gamma delta alpha beta beta gamma gamma gamma delta" --> "alpha beta gamma delta alpha beta gamma delta" ``` Words will be separated by a single space. There will...
5,385
Write a function that returns the number of arguments it received. ``` args_count() --> 0 args_count('a') --> 1 args_count('a', 'b') --> 2 ``` ```if:python,ruby The function must work for keyword arguments too: ``` ```if:python ~~~ args_count(x=10, y=20, 'z') --> 3 ~~~ ``` ```if:ruby ~~~ args_count(x:10, y:20, 'z'...
5,386
This is the first part of this kata series. Second part is [here](https://www.codewars.com/kata/assembler-interpreter-part-ii/). We want to create a simple interpreter of assembler which will support the following instructions: - `mov x y` - copies `y` (either a constant value or the content of a register) into regis...
5,387
### Happy Holidays fellow Code Warriors! Santa's senior gift organizer Elf developed a way to represent up to 26 gifts by assigning a unique alphabetical character to each gift. After each gift was assigned a character, the gift organizer Elf then joined the characters to form the gift ordering code. Santa asked his ...
5,388
You are given a positive natural number `n` (which is `n > 0`) and you should create a regular expression pattern which only matches the decimal representation of all positive natural numbers strictly less than `n` without leading zeros. The empty string, numbers with leading zeros, negative numbers and non-numbers sho...
5,389
The Mormons are trying to find new followers and in order to do that they embark on missions. Each time they go on a mission, each Mormon converts a fixed number of people (`reach`) into followers. This continues and every freshly converted Mormon as well as every original Mormon go on another mission and convert the ...
5,390
Create a function that returns the name of the winner in a fight between two fighters. Each fighter takes turns attacking the other and whoever kills the other first is victorious. Death is defined as having `health <= 0`. Each fighter will be a `Fighter` object/instance. See the Fighter class below in your chosen la...
5,391
When you were little, your mother used to make the most delicious cookies, which you could not resist. So, every now and then, when your mother didn't see you, you sneaked into the kitchen, climbed onto a stool to reach the cookie jar, and stole a cookie or two. However, sometimes while doing this, you would hear foot ...
5,392
<img src="https://i.imgur.com/ta6gv1i.png?1" /> --- <span style="font-weight:bold;font-size:1.5em;color:red">*Blaine is a pain, and that is the truth</span>&nbsp;- Jake Chambers* # <span style='color:orange'>Background</span> Blaine likes to deliberately crash toy trains! ## <span style='color:orange'>*Trains*</s...
5,393
Zonk is an addictive dice game. In each round the player rolls 6 dice. Then (s)he composes combinations of them. Each combination gives certain points. Then player can take one or more dice combinations to their hand and re-roll remaining dice or save the score. Dice in the player's hand won't be taken into account i...
5,394
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 consist of lower case letters and/or spaces.
5,395
# Task Given some points(array `A`) on the same line, determine the minimum number of line segments with length `L` needed to cover all of the given points. A point is covered if it is located inside some segment or on its bounds. # Example For `A = [1, 3, 4, 5, 8]` and `L = 3`, the output should be `2`. Check ou...
5,396
Let us go through an example. You have a string (here a short one): `s = "GCAGCaGCTGCgatggcggcgctgaggggtcttgggggctctaggccggccacctactgg"`, with only upper or lower cases letters A, C, G, T. You want to find substrings in this string. Each substring to find has a label. The different substrings to find are given in ...
5,397
A squared string has n lines, each substring being n characters long: For example: `s = "abcd\nefgh\nijkl\nmnop"` is a squared string of size `4`. We will use squared strings to code and decode texts. To make things easier we suppose that our original text doesn't include the character '\n'. #### Coding Input: - ...
5,398
An **anagram** is the result of rearranging the letters of a word to produce a new word (see [wikipedia](https://en.wikipedia.org/wiki/Anagram)). **Note:** anagrams are case insensitive Complete the function to return `true` if the two arguments given are anagrams of each other; return `false` otherwise. ## Example...
5,399