Dataset Viewer
Auto-converted to Parquet Duplicate
prompt
stringlengths
11
14k
messages
listlengths
2
2
On his trip to Luxor and Aswan, Sagheer went to a Nubian market to buy some souvenirs for his friends and relatives. The market has some strange rules. It contains n different items numbered from 1 to n. The i-th item has base cost ai Egyptian pounds. If Sagheer buys k items with indices x1, x2, ..., xk, then the cost ...
[ { "content": "On his trip to Luxor and Aswan, Sagheer went to a Nubian market to buy some souvenirs for his friends and relatives. The market has some strange rules. It contains n different items numbered from 1 to n. The i-th item has base cost ai Egyptian pounds. If Sagheer buys k items with indices x1, x2, ....
Chef is playing an easier variation of the board game ‘Risk’ with his friend Mike. There is an $N * M$ grid, depicting the world map. Each cell of the grid is either $1$ or $0$ where $1$ denotes that there is land on this cell, while $0$ denotes water. In a turn, a player can capture an uncaptured cell that has land,...
[ { "content": "Chef is playing an easier variation of the board game ‘Risk’ with his friend Mike. There is an $N * M$ grid, depicting the world map. Each cell of the grid is either $1$ or $0$ where $1$ denotes that there is land on this cell, while $0$ denotes water. \n\nIn a turn, a player can capture an uncapt...
Given are strings s and t of length N each, both consisting of lowercase English letters. Let us form a new string by alternating the characters of S and the characters of T, as follows: the first character of S, the first character of T, the second character of S, the second character of T, ..., the N-th character of...
[ { "content": "Given are strings s and t of length N each, both consisting of lowercase English letters.\n\nLet us form a new string by alternating the characters of S and the characters of T, as follows: the first character of S, the first character of T, the second character of S, the second character of T, .....
Read problems statements in Mandarin chinese, Russian and Vietnamese as well. Chef is at a Code Expo where many coders are present discussing, solving, sharing, and eavesdropping on solutions :P He recently learnt that a former HackerPlant employee, Reziba, who is now working at KodeKarma stole some questions for th...
[ { "content": "Read problems statements in Mandarin chinese, Russian and Vietnamese as well. \n\nChef is at a Code Expo where many coders are present discussing, solving, sharing, and eavesdropping on solutions :P\n\nHe recently learnt that a former HackerPlant employee, Reziba, who is now working at KodeKarma s...
Implement a Queue using Linked List. A Query Q is of 2 Types (i) 1 x (a query of this type means pushing 'x' into the queue) (ii) 2 (a query of this type means to pop an element from the queue and print the poped element) Example 1: Input: Q = 5 Queries = 1 2 1 3 2 1 4 2 Output: 2 3 Explanation: n the first tes...
[ { "content": "Implement a Queue using Linked List. \nA Query Q is of 2 Types\n(i) 1 x (a query of this type means pushing 'x' into the queue)\n(ii) 2 (a query of this type means to pop an element from the queue and print the poped element)\nExample 1:\nInput:\nQ = 5\nQueries = 1 2 1 3 2 1 4 2\nOutput: 2 ...
You are given an array A, of N elements. Find minimum index based distance between two elements of the array, x and y such that (x!=y). Example 1: Input: N = 4 A[] = {1,2,3,2} x = 1, y = 2 Output: 1 Explanation: x = 1 and y = 2. There are two distances between x and y, which are 1 and 3 out of which the least is 1. Exa...
[ { "content": "You are given an array A, of N elements. Find minimum index based distance between two elements of the array, x and y such that (x!=y).\nExample 1:\nInput:\nN = 4\nA[] = {1,2,3,2}\nx = 1, y = 2\nOutput: 1\nExplanation: x = 1 and y = 2. There are\ntwo distances between x and y, which are\n1 and 3 o...
You are given a multiset of n integers. You should select exactly k of them in a such way that the difference between any two of them is divisible by m, or tell that it is impossible. Numbers can be repeated in the original multiset and in the multiset of selected numbers, but number of occurrences of any number in mu...
[ { "content": "You are given a multiset of n integers. You should select exactly k of them in a such way that the difference between any two of them is divisible by m, or tell that it is impossible.\n\nNumbers can be repeated in the original multiset and in the multiset of selected numbers, but number of occurre...
Given 2 integers $u$ and $v$, find the shortest array such that bitwise-xor of its elements is $u$, and the sum of its elements is $v$. -----Input----- The only line contains 2 integers $u$ and $v$ $(0 \le u,v \le 10^{18})$. -----Output----- If there's no array that satisfies the condition, print "-1". Otherwise:...
[ { "content": "Given 2 integers $u$ and $v$, find the shortest array such that bitwise-xor of its elements is $u$, and the sum of its elements is $v$.\n\n\n-----Input-----\n\nThe only line contains 2 integers $u$ and $v$ $(0 \\le u,v \\le 10^{18})$.\n\n\n-----Output-----\n\nIf there's no array that satisfies the...
Ivan recently bought a detective book. The book is so interesting that each page of this book introduces some sort of a mystery, which will be explained later. The $i$-th page contains some mystery that will be explained on page $a_i$ ($a_i \ge i$). Ivan wants to read the whole book. Each day, he reads the first page ...
[ { "content": "Ivan recently bought a detective book. The book is so interesting that each page of this book introduces some sort of a mystery, which will be explained later. The $i$-th page contains some mystery that will be explained on page $a_i$ ($a_i \\ge i$).\n\nIvan wants to read the whole book. Each day,...
# The President's phone is broken He is not very happy. The only letters still working are uppercase ```E```, ```F```, ```I```, ```R```, ```U```, ```Y```. An angry tweet is sent to the department responsible for presidential phone maintenance. # Kata Task Decipher the tweet by looking for words with known meaning...
[ { "content": "# The President's phone is broken\n\nHe is not very happy.\n\nThe only letters still working are uppercase ```E```, ```F```, ```I```, ```R```, ```U```, ```Y```.\n\nAn angry tweet is sent to the department responsible for presidential phone maintenance.\n\n\n# Kata Task\n\nDecipher the tweet by loo...
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
32