domain
stringclasses
7 values
sub_source
stringclasses
15 values
coding_subclass
stringclasses
6 values
messages
listlengths
2
24
tools
listlengths
1
94
⌀
Coding
Dolci-Python-Algorithms
engineering_oop_api
[ { "role": "user", "content": "Write a program that classifies an email as spam or not spam using a simple rule-based approach. The program should read the entire email text from standard input (as a single line).\n\nAn email is classified as spam if it contains any of the following bigrams (two consecutive ...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "Vlad, like everyone else, loves to sleep very much.\n\nEvery day Vlad has to do $n$ things, each at a certain time. For each of these things, he has an alarm clock set, the $i$-th of them is triggered on $h_i$ hours $m_i$ minutes every day ($0 \\le h_i < 24, 0 \\le m_i < 60$). ...
null
Coding
Dolci-Python-Algorithms
engineering_oop_api
[ { "role": "user", "content": "Write a program that reads a single line containing a mathematical expression from standard input and evaluates it, outputting the result as an integer.\n\nThe expression will use Roman numerals for all operands and can include the following operators:\n\n- Addition (+)\n- Subt...
null
Coding
Dolci-Python-Algorithms
engineering_oop_api
[ { "role": "user", "content": "Write a program that reads two sorted integer lists from standard input, merges them into a single sorted list (without using any built-in sorting functions), and prints the merged list. The lists can include duplicate and negative numbers.\n\nInput Format:\n- The first line co...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "Walter White is on a tour to sell meth. There are N cities.\n\nEach city has a id between 1 and N (both inclusive).\n\nYou are given cost matrix.\n\nIn cost matrix, the j\\;th element in the i\\;th row denotes the cost of travelling between cities with id i and j.\n\ncost[i][j]...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "A sequence of integers is called a beautiful sequence if all the integers in it are positive and it is a strictly increasing sequence.\n\nGiven a sequence of integers, you have to make it a beautiful sequence. For that you can change any element you want, but you should make as...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "Chef Palin, as his name suggests, is always very interested in palindromic strings. Recently, he made a pretty interesting discovery on palindromes and that made him feel really Lucky. He came across something known as Lucky Palindromes. He defines a string as being a lucky pal...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "Given a sentence as a string S. Calculate difficulty of a given sentence. \nDifficulty of sentence is defined as 5*(number of hard words) + 3*(number of easy words). A word in the given string is considered hard if it has 4 consecutive consonants or number of consonants are mor...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "For a dynamic list $L$ of integers, perform a sequence of the following operations. $L$ has a special element called END at the end of the list and an element of $L$ is indicated by a cursor.\n\n* insert($x$): Insert $x$ before the element indicated by the cursor. After this op...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "The Nordic Company of Passing Carriages is losing money at an alarming rate because most of their trains are empty. However, on some lines the passengers are complaining that they cannot fit in the cars and have to wait for the next train!\n\nThe authorities want to fix this si...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "Croatia’s national television programme is broadcasting an entertainment show titled “I Love Croatia”, modeled on the licensed format I love my country. In this show two teams of celebrities and public figures play various games which require knowledge about Croatia. One of the...
null
Coding
Dolci-Python-Algorithms
engineering_oop_api
[ { "role": "user", "content": "You are given 4·n + 1 distinct points on the plane (2 ≤ n ≤ 10). All but exactly one of these points lie on the boundary of an axis-aligned square (its sides are parallel to the coordinate axes). Every side of that square contains at least n of the given points.\n\nInput\nThe f...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "Problem text...\nMany persons are familiar with the Roman numerals for relatively small\nnumbers. The symbols i, v, x, l and c represent the decimal values 1, 5, 10, 50 and\n100 respectively. To represent other values, these symbols, and multiples where\nnecessary, are concaten...
null
Coding
Dolci-Python-Algorithms
engineering_oop_api
[ { "role": "user", "content": "An array b1, b2, …, bn of positive integers is called good if the sum of every pair of neighbouring elements is the same, i.e. there exists a value k such that\nb1 + b2 = b2 + b3 = … = b_{n-1} + b_n = k.\n\nYou are given an array a of length n. You may reorder (permute) its ele...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "Cat Noku has obtained a map of the night sky. On this map, he found a constellation with n stars numbered from 1 to n. For each i, the i-th star is located at coordinates (xi, yi). No two stars are located at the same position.\n\nIn the evening Noku is going to take a look at ...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "Amazin’ Inc, an up-and-coming company in e-commerce, has recently optimized its operations to make the most out of its workers. Thanks to state-of-the-art prediction methods, Amazin’ now knows in advance how many workers will be needed each day for the foreseeable future. Using...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "You are given a tuple generator $$$f^{(k)} = (f_1^{(k)}, f_2^{(k)}, \\dots, f_n^{(k)})$$$, where $$$f_i^{(k)} = (a_i \\cdot f_i^{(k - 1)} + b_i) \\bmod p_i$$$ and $$$f^{(0)} = (x_1, x_2, \\dots, x_n)$$$. Here $$$x \\bmod y$$$ denotes the remainder of $$$x$$$ when divided by $$$...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "You have just completed a brave journey to see The Wizard of Odds, who agrees to grant you any wish, so long as you can complete the following puzzle:\n\nThe Wizard starts by telling you two integers: $N$ and $K$. He then secretly selects a number from $1$ to $N$ (inclusive), a...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "White Falcon just solved the data structure problem below using heavy-light decomposition. Can you help her find a new solution that doesn't require implementing any fancy techniques? \n\nThere are $2$ types of query operations that can be performed on a tree:\n\n1 u x: Assign ...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "Read problem statements in [Hindi], [Bengali], [Mandarin Chinese], [Russian], and [Vietnamese] as well.\n\nChef had three sequences of real numbers $k_{1}, k_{2}, \\ldots, k_{N}$, $c_{1}, c_{2}, \\ldots, c_{N}$ and $x_{1}, x_{2}, \\ldots, x_{N}$. Unfortunately, he lost the sequ...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "Bear Limak prepares problems for a programming competition. Of course, it would be unprofessional to mention the sponsor name in the statement. Limak takes it seriously and he is going to change some words. To make it still possible to read, he will try to modify each word as l...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "An integer sequence is called beautiful if the difference between any two consecutive numbers is equal to $1$. More formally, a sequence $s_1, s_2, \\ldots, s_{n}$ is beautiful if $|s_i - s_{i+1}| = 1$ for all $1 \\leq i \\leq n - 1$.\n\nTrans has $a$ numbers $0$, $b$ numbers $...
null
Coding
Dolci-Python-Algorithms
engineering_oop_api
[ { "role": "user", "content": "You are given a list of integers via standard input, separated by spaces. Write a Python program that reads these integers, identifies the largest prime number in the list, and prints it. If there are no prime numbers in the list, print None. The program must correctly handle n...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "As the coach of your university’s ICPC teams, you encourage your students to solve as many Kattis problems as possible. This has numerous benefits — for example, it helps improve students’ competitive programming skills, and it also creates a strong sense of school spirit. The ...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "Bowling is a sport in which a player rolls a bowling ball towards a group of pins, the target being to knock down the pins at the end of a lane.\n\nIn this challenge, the rules of the game are slightly modified. Now, there are a given number of pins, and the pins are arranged i...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "You are given a directed graph with N vertices and M edges. The vertices are numbered 1, 2, ..., N, and the edges are numbered 1, 2, ..., M. Edge i points from Vertex a_i to Vertex b_i.\n\nFor each edge, determine whether the reversion of that edge would change the number of th...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "Differential pulse code modulation is one of the compression methods mainly used when compressing audio signals.\n\nThe audio signal is treated as an integer sequence (impulse sequence) on the computer. The integer sequence is a sample of the input signal at regular time interv...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "You have given tree consist of n vertices. Select a vertex as root vertex that satisfies the condition below.\n\n * For all vertices v_{1} and v_{2}, if distance(root, v_{1}) = distance(root, v_{2}) then degree(v_{1}) = degree(v_{2}), where degree means the number of vertices ...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "Our new contest submission system keeps a chronological log of all submissions made by each team during the contest. With each entry, it records the number of minutes into the competition at which the submission was received, the letter that identifies the relevant contest prob...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "You finally woke up after this crazy dream and decided to walk around to clear your head. Outside you saw your house's fence — so plain and boring, that you'd like to repaint it.\n\nYou have a fence consisting of $$$n$$$ planks, where the $$$i$$$-th plank has the color $$$a_i$$...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "problem\n\nYou love pasta, and you make and eat pasta for dinner every day. You can make three types of pasta: tomato sauce, cream sauce, and basil sauce.\n\nI decided to plan a dinner for N days. Choose one of the three types of pasta each day. However, if the same pasta conti...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "This year a Chunin Selection Exam is held again in Konoha, and taking part in it are $$$n$$$ ninjas named $$$s_1$$$, $$$s_2$$$, ..., $$$s_n$$$. All names are distinct. One of the exam stages consists of fights between the participants. This year the rules determining the ninjas...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "Wall Maria has been broken! Eren must evacuate as soon as possible from his house. He must find the fastest route to escape within Wall Maria before the titans rush in. Wall Maria is represented as a $N \\times M$ grid in which Eren can move horizontally or vertically.\n\nThere...
null
Coding
Dolci-Python-Algorithms
engineering_oop_api
[ { "role": "user", "content": "Develop a function in Python that calculates the average of the five highest and five lowest numbers in a specific list without using built-in Python sorting and max/min functions. The function should return a specific message if the list has less than five elements. Implement ...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "Ordinary Jigsaw puzzles are solved with visual hints; players solve a puzzle with the picture which the puzzle shows on finish, and the diverse patterns of pieces. Such Jigsaw puzzles may be suitable for human players, because they require abilities of pattern recognition and i...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "We constructed a rectangular parallelepiped of dimensions A \\times B \\times C built of ABC cubic blocks of side 1. Then, we placed the parallelepiped in xyz-space as follows:\n\n* For every triple i, j, k (0 \\leq i < A, 0 \\leq j < B, 0 \\leq k < C), there exists a block tha...
null
Coding
Dolci-Python-Algorithms
engineering_oop_api
[ { "role": "user", "content": "Write a Python program that reads a string from standard input, computes the frequency of each word in the string (ignoring punctuation and case), excludes commonly occurring stop words (such as 'the', 'and', 'is', etc.), then prints a list of tuples containing the words and th...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "A scientist discovered a strange variation of amoeba. The scientist named it numoeba. A numoeba, though it looks like an amoeba, is actually a community of cells, which always forms a tree.\n\nThe scientist called the cell leader that is at the root position of the tree. For ex...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "Excitement is rapidly increasing in anticipation of the concluding debate at the 0x7E4 Undemocratic Inclinational Unconvention, where the party’s candidate for the office of Student Assistant to the Old Chemistry Building Assistant Printer Service Technician’s Assistant will be...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "This is an interactive optimization problem. Instead of having to find the best answer, each solution will get score according to its efficiency. As the problem is interactive, during the testing process, the jury program and your solution will exchange messages via standard in...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "Read problem statements in [Hindi], [Bengali], [Mandarin Chinese], [Russian], and [Vietnamese] as well.\n\nThere is a robot in the cell $(0, 0)$ of an infinite grid. One cell $(X, Y)$ contains an obstacle and all other cells are free. We only know that $1 ≤ X ≤ R$ and $1 ≤ Y ≤ ...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "Sherlock Holmes suspects his archenemy Professor Moriarty is once again plotting something diabolical. Sherlock's companion, Dr. Watson, suggests Moriarty may be responsible for MI6's recent issues with their supercomputer, The Beast. \n\nShortly after resolving to investigate,...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "N frogs are positioned at one end of the pond. All frogs want to reach the other end of the pond as soon as possible. The pond has some leaves arranged in a straight line. Each frog has the strength to jump exactly K leaves. For example, a frog having strength 2 will visit the...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "Given a string, remove characters until the string is made up of any two alternating characters. When you choose a character to remove, all instances of that character must be removed. Determine the longest string possible that contains just two alternating letters.\n\nExampl...
null
Coding
Dolci-Python-Algorithms
engineering_oop_api
[ { "role": "user", "content": "Given two integers representing a range of years (inclusive), determine if there are more leap years than non-leap years in that range.\n\nInput Format:\n- Two integers separated by a space: the start year and end year (inclusive).\n\nOutput Format:\n- Print \"True\" (without q...
null
Coding
Dolci-Python-Algorithms
engineering_oop_api
[ { "role": "user", "content": "Given a binary search tree (BST), find the k-th smallest element in the tree, where k is a positive integer. The BST is constructed using the TreeNode and BST classes as defined below.\n\nInput Format:\n- The first line contains an integer k (1 ≤ k ≤ number of nodes in the BST)...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "You are given an array $a$ consisting of $n$ integers $a_1, a_2, \\dots, a_n$. You want to split it into exactly $k$ non-empty non-intersecting subsegments such that each subsegment has odd sum (i. e. for each subsegment, the sum of all elements that belong to this subsegment i...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "A group of $$$n$$$ alpinists has just reached the foot of the mountain. The initial difficulty of climbing this mountain can be described as an integer $$$d$$$.\n\nEach alpinist can be described by two integers $$$s$$$ and $$$a$$$, where $$$s$$$ is his skill of climbing mountai...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "More Unsullied army are joining Daenerys Stormborn of the House Targaryen, the First of Her Name, the Unburnt, Queen of Meereen, \nQueen of the Andals and the Rhoynar and the First Men, Khaleesi of the Great Grass Sea, Breaker of Chains, and Mother of Dragons.\n\nWe know Grey W...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "The scientists have recently discovered wormholes — objects in space that allow to travel very long distances between galaxies and star systems.\n\nThe scientists know that there are n galaxies within reach. You are in the galaxy number 1 and you need to get to the galaxy numbe...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "Riley is a very bad boy, but at the same time, he is a yo-yo master. So, he decided to use his yo-yo skills to annoy his friend Anton.\n\nAnton's room can be represented as a grid with $n$ rows and $m$ columns. Let $(i, j)$ denote the cell in row $i$ and column $j$. Anton is cu...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "Given a number, the task is to set all odd bits of a number.\nNOTE: Position of Least Significant Bit is considered as 1.\nExample 1:\nInput: n = 20\nOutput: 21 \nExplanation: Binary representation of 20 \nis 10100. Setting all odd bits make the \nnumber 10101 which is binary\n...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "There are n cities along the road, which can be represented as a straight line. The i-th city is situated at the distance of a_i kilometers from the origin. All cities are situated in the same direction from the origin. There are m trucks travelling from one city to another. \n...
null
Coding
Dolci-Python-Algorithms
engineering_oop_api
[ { "role": "user", "content": "Given a string of digits as input, output all possible letter combinations that the number could represent on a phone keypad. The mapping is as follows: 2 -> 'abc', 3 -> 'def', 4 -> 'ghi', 5 -> 'jkl', 6 -> 'mno', 7 -> 'pqrs', 8 -> 'tuv', 9 -> 'wxyz'.\n\nInput:\nA single line co...
null
Coding
Dolci-Python-Algorithms
engineering_oop_api
[ { "role": "user", "content": "Given a JSON string as standard input, extract and output all values associated with the key 'name', regardless of how deeply nested they are within the JSON's structure. If there are multiple occurrences of the 'name' key at any nesting level, print their values (one per line)...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "Given string s that is appended with a number at last. The task is to check whether the length of string excluding that number is equal to that number. \nExample 1:\nInput: s = \"geeks5\"\nOutput: 1\nExplanation: Length of geeks is 5\nand the last number is also 5.\nExample 2:...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "Given two numbers M and N. The task is to find the position of the rightmost different bit in the binary representation of numbers.\nExample 1: \nInput: M = 11, N = 9\nOutput: 2\nExplanation: Binary representation of the given \nnumbers are: 1011 and 1001, \n2nd bit from right ...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "This is Fibonacci madness.\nGiven a number n. Print the first n Fibonacci numbers in reverse order.\n\nInput:\n\nFirst line is number T denoting number of test cases.\nT lines follow. Each line has number N.\n\nOutput:\n\nPrint the first n Fibonacci numbers in reverse order for...
null
Coding
Dolci-Python-Algorithms
engineering_oop_api
[ { "role": "user", "content": "You are tasked with creating a function that simulates the setup of a home automation system integration given an IP address. The function should take a single input parameter, `ip_address`, which is a string representing the IP address of the home automation controller. The fu...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "problem\n\nThere are $ N $ islands numbered from $ 1 $ to $ N $.\nEach island has $ N-1 $ bridges, allowing any $ 2 $ island to move to each other across several bridges.\nEach bridge has durability, and the durability of the $ i $ th bridge given the input is $ w_i $.\nThere a...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way.\n\nYou are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "The famous Arora-Mitchell approximation algorithm for the Euclidean Travelling Salesman Problem (Euclidean TSP) was discovered independently by Sanjeev Arora and Joseph S. B. Mitchell in 1998. It can approximate the value of an optimal TSP tour in $d$ dimensions within a factor...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "Snuke loves puzzles.\nToday, he is working on a puzzle using S- and c-shaped pieces.\nIn this puzzle, you can combine two c-shaped pieces into one S-shaped piece, as shown in the figure below:\nSnuke decided to create as many Scc groups as possible by putting together one S-sha...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "We define super digit of an integer $\\boldsymbol{x}$ using the following rules: \n\nGiven an integer, we need to find the super digit of the integer.\n\nIf $\\boldsymbol{x}$ has only $\\mbox{I}$ digit, then its super digit is $\\boldsymbol{x}$. \nOtherwise, the super digit ...
null
Coding
competitive-programming-cpp
cp_cpp_stdin
[ { "role": "user", "content": "Geek wants to make a special space for candies on his bookshelf. Currently, it has N books, each of whose height is represented by the array height[] and has unit width.\nHelp him select 2 books such that he can store maximum candies between them by removing all the other books...
null
Coding
Dolci-Python-Algorithms
func_signature_completion
[ { "role": "user", "content": "Given a string, return a list of its characters where each character is followed by an empty string if it is classified as a 'wide' character. A 'wide' character is defined as a character that occupies more space than a regular ASCII character. For this problem, assume that cha...
null
Coding
Dolci-Python-Algorithms
func_signature_completion
[ { "role": "user", "content": "You are tasked with creating a Python function that filters a list of ratings based on a specified category. The function should take two parameters: a list of ratings, where each rating is a string in the format 'rating,category', and a list of categories to filter by. Your go...
null
Coding
Dolci-Python-Algorithms
func_signature_completion
[ { "role": "user", "content": "You are tasked with creating a function 'initialize_node' that simulates the initialization of a node in a messaging system. The function takes two parameters: 'node_name' (a string representing the name assigned to the node) and 'publish_topic' (a string representing the name ...
null
Coding
Dolci-Python-Algorithms
func_signature_completion
[ { "role": "user", "content": "Given a dictionary that maps string keys to a list of integers, write a function that takes the dictionary as input and returns a new dictionary where each key is associated with the sum of its corresponding list of integers. The keys in the output dictionary should maintain th...
null
Coding
Dolci-Python-Algorithms
func_signature_completion
[ { "role": "user", "content": "Write a function `is_valid_word(word: str) -> bool` that checks if a given word is a valid English word. The function should return True if the word is found in a predefined set of valid English words, and False otherwise. You may assume that the input word will only contain lo...
null
Coding
Dolci-Python-Algorithms
func_signature_completion
[ { "role": "user", "content": "Given two lists `a` and `b` containing elements that can be either integers or strings, write a function `is_prefix(a: List[Union[int, str]], b: List[Union[int, str]]) -> bool` that checks if list `a` is a prefix of list `b`. A list `a` is considered a prefix of list `b` if all...
null
Coding
Dolci-Python-Algorithms
func_signature_completion
[ { "role": "user", "content": "You are tasked with creating a function that searches for posts based on a given keyword. You need to implement a function `search_posts(posts, keyword)` that takes a list of post objects and a keyword as parameters. Each post object has attributes `title`, `content`, and `user...
null
Coding
Dolci-Python-Algorithms
func_signature_completion
[ { "role": "user", "content": "Given a list of integers, return a new list containing only the unique elements from the original list. The order of elements in the new list should be the same as the first occurrence of each unique element in the original list. Write a function `unique_elements(arr: List[int]...
null
Coding
Dolci-Python-Algorithms
func_signature_completion
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of module actions in a software system. Each module action is represented as a dictionary with the following structure: {\"module\": str, \"action\": str, \"params\": dict}. Your task is to implement a function `...
null
Coding
Dolci-Python-Algorithms
func_signature_completion
[ { "role": "user", "content": "You are tasked with creating a summary for a customer's order given the user's details and the items included in the order. Write a function `get_order_summary(username: str, email: str, items: List[str]) -> str` that takes the user's username, email, and a list of items includ...
null
Coding
Dolci-Python-Algorithms
func_signature_completion
[ { "role": "user", "content": "Implement a function that takes a list of floating-point numbers and returns the minimum decimal value from that list. The input list will contain numbers ranging from -50 to 50, inclusive. \n\nYou need to define the following function:\n\n```python\ndef find_min_decimal(decima...
null
Coding
Dolci-Python-Algorithms
func_signature_completion
[ { "role": "user", "content": "Given a list of first names of learners in a classroom, implement a function `roll_call` that returns a list of full names for each learner in the format 'FirstName LastName'. Assume the last name for each learner is 'Smith'. For example, if the input list is ['John', 'Jane'], ...
null
Coding
Dolci-Python-Algorithms
func_signature_completion
[ { "role": "user", "content": "You are tasked with implementing a simplified spell checker for a text editor. Write a function `spellcheck(text: str, dictionary: List[str]) -> List[str]` that takes a string `text`, which represents the content of a document, and a list of strings `dictionary`, which contains...
null
Coding
Dolci-Python-Algorithms
func_signature_completion
[ { "role": "user", "content": "Given a string of text, write a function that analyzes the text to determine the frequency of each unique word. A word is defined as a sequence of non-whitespace characters. The function should ignore the case of the letters and remove any punctuation marks from the text. The o...
null
Coding
Dolci-Python-Algorithms
func_signature_completion
[ { "role": "user", "content": "You are given a list of comments, where each comment is represented as a dictionary. Each dictionary contains a key 'reviewRating' that stores another dictionary with a key 'ratingValue'. Your task is to implement a function that extracts the 'ratingValue' from each comment and...
null
Coding
Dolci-Python-Algorithms
func_signature_completion
[ { "role": "user", "content": "Given a list of values, implement a function `FunctionB(lst)` that returns a new list containing all unique integer values from the input list that are less than 50, sorted in descending order. The function should ignore any non-integer values and handle duplicate integers appr...
null
Coding
Dolci-Python-Algorithms
func_signature_completion
[ { "role": "user", "content": "You are tasked with creating a function that simulates a command execution in a shell environment. This function will take a single string command as input and return the output of the command as a string. The command can be one of three predefined commands: 'echo Hello World',...
null
Coding
Dolci-Python-Algorithms
func_signature_completion
[ { "role": "user", "content": "You are given a list of student dictionaries, where each dictionary contains information about a student, including their 'github_repo'. Your task is to implement a function that takes in this list of students and returns a list of all unique GitHub repositories from the studen...
null
Coding
Dolci-Python-Algorithms
func_signature_completion
[ { "role": "user", "content": "You are tasked with implementing a function that takes a 2D array (list of lists) as input and returns a deep copy of that array. Your implementation should ensure that modifications to the copied array do not affect the original array. Additionally, your function should handle...
null
Coding
Dolci-Python-Algorithms
func_signature_completion
[ { "role": "user", "content": "Given a float value representing a tolerance percentage (e.g., 0.1 for ±10%), write a function `spread_tolerance(value: float) -> str` that returns a string formatted as 'SPREAD,value', where 'value' is the input tolerance. The function should only accept values between -1.0 an...
null
Coding
Dolci-Python-Algorithms
func_signature_completion
[ { "role": "user", "content": "You are given a list of table names represented as strings. Write a function `get_table_names` that takes a list of table names and returns a new list containing only the table names that start with the letter 'a'. The returned list should maintain the original order of the inp...
null
Coding
Dolci-Python-Algorithms
func_signature_completion
[ { "role": "user", "content": "You are tasked with calculating the compression rate of a blockchain block based on the size of the compressed data and the original size of the block's data. The compression rate is defined as the ratio of compressed size to original size, expressed as a percentage. You need t...
null
Coding
Dolci-Python-Algorithms
func_signature_completion
[ { "role": "user", "content": "Implement a function `years_of_service` that takes an employee's joining date as a string in the format 'YYYY-MM-DD' and returns the number of complete years the employee has worked at the company as of today. The function should handle invalid date formats by returning -1.", ...
null
Coding
Dolci-Python-Algorithms
func_signature_completion
[ { "role": "user", "content": "Given a configuration dictionary that represents repositories, write a function `get_repo_paths` that takes a dictionary as input and returns a list of repository paths. The input dictionary has the following structure: it contains a key 'repos' which maps to another dictionary...
null
Coding
Dolci-Python-Algorithms
func_signature_completion
[ { "role": "user", "content": "You are tasked with determining if a user is subscribed to a specific trunk in a notification system. You need to implement a function `is_user_subscribed(user: str, trunk: str, subscriptions: List[Tuple[str, str, str]]) -> bool`. The function should take three parameters: a st...
null
Coding
Dolci-Python-Algorithms
func_signature_completion
[ { "role": "user", "content": "You are given a string representation of time in the format 'hh:mm:ss'. Your task is to write a function that converts this time into the total number of seconds since midnight. The input string will always be in the correct format and will consist of exactly two digits for hou...
null
Coding
Dolci-Python-Algorithms
func_signature_completion
[ { "role": "user", "content": "You are given a string which may contain multiple lines of text, including various warning messages. Your task is to extract all unique warning messages from the string, ignoring any lines that are commented out (lines that start with '#'). The warnings are defined as any line ...
null
Coding
Dolci-Python-Algorithms
func_signature_completion
[ { "role": "user", "content": "Given a string that may contain a year in the format 'YYYY', where 'YYYY' is a four-digit year between 1900 and 2099, write a function that extracts the first valid year from the string. If there is no valid year in the string, return None. The input string may contain addition...
null
Coding
Dolci-Python-Algorithms
func_signature_completion
[ { "role": "user", "content": "You are given a string representing a date in the format 'YYYY-MM-DD'. Your task is to implement a function that returns a string indicating the day of the week for that date. The output should be one of 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', or 'Su...
null
Coding
Dolci-Python-Algorithms
func_signature_completion
[ { "role": "user", "content": "Implement a function entitled `create_bicycle` that takes two parameters: a string `color` representing the color of the bicycle and an integer `wheels` representing the number of wheels the bicycle has. The function should return a dictionary with the keys 'color' and 'wheels'...
null
Coding
Dolci-Python-Algorithms
func_signature_completion
[ { "role": "user", "content": "Given a list of integers `xp` and a target integer `x`, return the index of the nearest value in `xp` that is less than or equal to `x`. If there is no such value, return -1. The list `xp` may contain duplicate values. You can assume that the list `xp` is sorted in ascending or...
null
Coding
Dolci-Python-Algorithms
func_signature_completion
[ { "role": "user", "content": "You are given a string that represents a series of definitions in the format 'NAME=VALUE' or just 'NAME'. Your task is to write a function that parses this string and returns a list of definitions where each definition is formatted as 'NAME=VALUE' or 'NAME' (if VALUE is not pro...
null
Coding
Dolci-Python-Algorithms
func_signature_completion
[ { "role": "user", "content": "Implement a function `create_mountain_bike(color: str, price: float, size: str) -> dict` that takes the color, price, and size of a mountain bike as inputs and returns a dictionary representing the mountain bike with keys 'color', 'price', and 'size'.", "tool_calls": null ...
null
Coding
Dolci-Python-Algorithms
func_signature_completion
[ { "role": "user", "content": "You are given a list of integers representing the number of items in several bags. Your task is to write a function that calculates the total number of items in all the bags. The function should take a single parameter, which is a list of integers, and return a single integer r...
null
Coding
Dolci-Python-Algorithms
func_signature_completion
[ { "role": "user", "content": "You are given a list of tuples, where each tuple contains the coordinates of two points in a 3D space. Each point is represented as a list of three integers, [x, y, z]. Your task is to compute the absolute distance between the z-coordinates of each pair of points. The distance ...
null