messages listlengths 2 765 |
|---|
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Write a function in C++ which takes a string as an argument, reverses the string using recursion, and returns the reversed string.\n\nRequirements:\n- The function must use recursion to reverse the string.\n- The function ... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Implement a python class named 'Temperature' that ranks a temperature value as cold, warm, or hot given a threshold value of 30."
},
{
"role": "assistant",
"content": "<think>\nThe user wants a Python class nam... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "You are given two sets, A and B, with at most 10^5 elements each. Your task is to write a function, cartesian_product(A: set, B: set) -> set, that returns the Cartesian product of the two sets as a set.\n\nThe Cartesian pr... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Given a string, convert it to upper case.\n\nInput: String: this string should be in upper case"
},
{
"role": "assistant",
"content": "<think>\nThis is a straightforward string manipulation problem. Python's bu... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Design a query in PostgreSQL to print the minimum and maximum of a given field.\n\nInput: Table name: Sales\nField name: Price"
},
{
"role": "assistant",
"content": "<think>\nThe user wants a PostgreSQL query t... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Create a function to detect if a given string contains all lowercase and uppercase letters of the English alphabet. The function should have a time complexity of O(n), where n is the length of the string, and a space compl... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "# 128 — Banco de Encaixes\nCrie uma oficina digital sobre a montagem de um banco de praça em madeira. Entregue um único HTML sem recursos externos com modelo WebGL tridimensional, assento, pernas, travessas e detalhes de u... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Develop an AI model to classify emails with spam contents."
},
{
"role": "assistant",
"content": "<think>\nThe user wants a spam email classifier. I'll build a complete, production-ready solution that:\n\n1. **... |
[
{
"role": "system",
"content": "Use only the Three.js core ES module from https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js. Do not import addons or legacy examples/js paths; implement any camera controls directly inside the HTML."
},
{
"role": "user",
"content": "Creat... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Create a JavaScript function that takes in an array of strings and returns a new array containing the same strings, but with all vowels removed. The function should have a time complexity of O(n) and should not use any bui... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Create a list containing the number of characters in each word of the sentence.\n\nInput: sentence = \"the quick brown fox jumps over the lazy dog\""
},
{
"role": "assistant",
"content": "<think>\nThe problem i... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Normalize the given string to lowercase and remove all punctuation marks.\n\nInput: Hey! How are you?"
},
{
"role": "assistant",
"content": "<think>\nThe task is to normalize a string by:\n1. Converting it to l... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Implement a search algorithm to find the first occurrence of an element in an array with the following additional constraints:\n1. The array is sorted in ascending order.\n2. The array may contain duplicate elements.\n3. T... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Write an algorithm to check if an array contains a given value and return the indices of all occurrences of the value. If the value is not found, return an empty array. The array can contain duplicate values.\n\nConstraint... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Edit the code to add an if statement that returns the string \"even\" if the value of the variable is even, a multiple of 3, and greater than 10, or the string \"odd\" if the value of the variable is odd, not a multiple of... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Create a class in Java that takes two arguments, a name of type String and an id of type int. The name should be limited to a maximum length of 15 characters and should only consist of alphabetic characters. The id should ... |
[
{
"role": "system",
"content": "Use only the Three.js core ES module from https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js. Do not import addons or legacy examples/js paths; implement any camera controls directly inside the HTML."
},
{
"role": "user",
"content": "Build... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Create a function to select all the div tags within a document."
},
{
"role": "assistant",
"content": "<think>\nThe user wants a function to select all div tags within an HTML document. I'll use BeautifulSoup, ... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Using a while loop, print the numbers from 1 to 10."
},
{
"role": "assistant",
"content": "<think>\nThe task is to print numbers 1 to 10 using a while loop. I'll initialize a counter at 1, loop while it's <= 10... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Create a new database in MySQL, with a table named \"users\", and add 3 records."
},
{
"role": "assistant",
"content": "<think>\nThe user wants to create a MySQL database with a \"users\" table and insert 3 rec... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Write a Python function for: Write a function to sort a list of elements.\n\nTest cases that must pass:\nassert pancake_sort([15, 79, 25, 38, 69]) == [15, 25, 38, 69, 79]\nassert pancake_sort([98, 12, 54, 36, 85]) == [12, ... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Write a Python function to input a number and print if it is positive, negative, or zero"
},
{
"role": "assistant",
"content": "<think>\nThis is a simple conditional problem. I need to:\n1. Accept a number (int... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Suggest an algorithm to calculate the multiplication of two integers without using the operator '*'. In addition, the algorithm should have a time complexity of O(log n), where n is the value of the smaller integer. Moreov... |
[
{
"role": "system",
"content": "Use only the Three.js core ES module from https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js. Do not import addons or legacy examples/js paths; implement any camera controls directly inside the HTML."
},
{
"role": "user",
"content": "Creat... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Describe a pipelined architecture for a processor"
},
{
"role": "assistant",
"content": "<think>\nThe user wants a description of a pipelined processor architecture. I'll provide a comprehensive explanation of ... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Write a recursive function in JS to traverse a multi-dimensional array and return the sum of all the elements in the array. However, the function should exclude any negative numbers from the sum.\n\nlet arr = [\n [1, 2, 3... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Create an array of 10 numbers between 0 and 20, both included."
},
{
"role": "assistant",
"content": "<think>\nThe user wants an array of 10 numbers between 0 and 20 (inclusive). I'll generate 10 random integer... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Change the given string to a list of characters, where each character is represented as a string. Additionally, sort the list in descending order. The time complexity of your solution should be O(n log n), where n is the l... |
[
{
"role": "system",
"content": "Use only the Three.js core ES module from https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js. Do not import addons or legacy examples/js paths; implement any camera controls directly inside the HTML."
},
{
"role": "user",
"content": "Build... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Sum the numbers in the given array using the reduce function. The numbers in the array are positive integers ranging from 1 to 100. Find the sum of the numbers excluding any numbers that are divisible by both 3 and 5. Addi... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Write a query to display the average age of the students.\n\nInput: Table Name: Students"
},
{
"role": "assistant",
"content": "<think>\nThe user wants a SQL query to calculate the average age of students from ... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Convert the following array to a numpy array and print it:\n\nInput: [2, 4, 6, 8]"
},
{
"role": "assistant",
"content": "<think>\nThis is a simple task: convert a Python list to a numpy array using np.array() a... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Develop an algorithm to find the maximum consecutive repeating vowel in a given string, where the vowels must be in reverse alphabetical order (u, o, i, e, a) and the maximum length of consecutive repeating vowels should b... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Write a function in Javascript to return the k-th highest number in an array, where k is a parameter passed to the function. The function should also handle cases where k is larger than the size of the array. Additionally,... |
[
{
"role": "system",
"content": "Use only the Three.js core ES module from https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js. Do not import addons or legacy examples/js paths; implement any camera controls directly inside the HTML."
},
{
"role": "user",
"content": "Make ... |
[
{
"role": "system",
"content": "Use only the Three.js core ES module from https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js. Do not import addons or legacy examples/js paths; implement any camera controls directly inside the HTML."
},
{
"role": "user",
"content": "Pleas... |
[
{
"role": "system",
"content": "Use only the Three.js core ES module from https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js. Do not import addons or legacy examples/js paths; implement any camera controls directly inside the HTML."
},
{
"role": "user",
"content": "Pleas... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Create a function to format a given list of numbers with commas as thousands separators."
},
{
"role": "assistant",
"content": "<think>\nThe task is to take a list of numbers and return formatted strings where ... |
[
{
"role": "system",
"content": "Use only the Three.js core ES module from https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js. Do not import addons or legacy examples/js paths; implement any camera controls directly inside the HTML."
},
{
"role": "user",
"content": "Make ... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Suggest an algorithm to determine whether a string is a palindrome. Your solution should have a time complexity of O(n) and a space complexity of O(1). Additionally, your algorithm should handle cases where the string may ... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Find the product of the elements of a given array in Python.\n\nInput: [1, 2, 3]"
},
{
"role": "assistant",
"content": "<think>\nThe problem is straightforward: multiply all elements in an array together.\n\nEd... |
[
{
"role": "system",
"content": "Use only the Three.js core ES module from https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js. Do not import addons or legacy examples/js paths; implement any camera controls directly inside the HTML."
},
{
"role": "user",
"content": "Make ... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Edit the following HTML to create a heading with the title \"Welcome to our Website\" and apply a custom font style. The font style should be a combination of three different font families, \"Arial\", \"Verdana\", and \"Ti... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "There is an array of integer numbers. You need to replace all the odd numbers with 0.\n\nInput: arr = [1, 2, 3, 4, 5, 6, 7, 8, 9]"
},
{
"role": "assistant",
"content": "<think>\nThe problem is simple: iterate t... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Create an HTML page that includes three buttons with labels \"A\", \"B\" and \"C\". When button \"A\" is clicked, display a message saying \"Button A was clicked\" in an alert box. When button \"B\" is clicked, change the ... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Create a for loop in Python to find the combined length of all the strings in a list.\n\nInput: list = ['Data', 'Science', 'AI']"
},
{
"role": "assistant",
"content": "<think>\nThe problem is simple: iterate th... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Find the product of all values in a given dictionary.\n\nInput: Dictionary: {'a': 10, 'b': 20, 'c': 30}"
},
{
"role": "assistant",
"content": "<think>\nThe task is to compute the product of all values in a dict... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Find the difference between the two dates\n\nInput: import datetime\ndate1 = datetime.date(2020, 5, 15)\ndate2 = datetime.date(2020, 4, 15)"
},
{
"role": "assistant",
"content": "<think>\nThe problem is simple:... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Split the string \"hello world 123 !@#\" into an array of individual words in JavaScript. The input string may contain special characters, numbers, and multiple spaces between words. Ensure that each word in the array is u... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Create an API call in Python to search for a movie by title."
},
{
"role": "assistant",
"content": "<think>\nThe user wants a Python API call to search for a movie by title. I'll use the OMDb API (Open Movie Da... |
[
{
"role": "system",
"content": "Use only the Three.js core ES module from https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js. Do not import addons or legacy examples/js paths; implement any camera controls directly inside the HTML."
},
{
"role": "user",
"content": "Pleas... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Write a SQL query to identify the employees whose salary is greater than $50k."
},
{
"role": "assistant",
"content": "```sql\nSELECT *\nFROM employees\nWHERE salary > 50000;\n```\n\n**Explanation:**\n\n| Clause... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "## Problem Statement\n\nWrite a Python function called `get_author` that takes in a string parameter representing the title of a book and returns the author of the book. The function should ignore any leading or trailing w... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Consider the following code that reads data from multiple files and prints their contents. Identify the data structure being used and explain how it can be optimized for better performance.\n\nfilenames = ['/home/user/proj... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Create a SQL query that fetches all customers from a table named 'customers' whose name starts with 'John'"
},
{
"role": "assistant",
"content": "<think>\nThe user wants a SQL query to select customers whose na... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Write a C++ function to find the maximum element in an array."
},
{
"role": "assistant",
"content": "<think>\nThe user wants a C++ function to find the maximum element in an array. I'll provide:\n1. A template ... |
[
{
"role": "system",
"content": "Use only the Three.js core ES module from https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js. Do not import addons or legacy examples/js paths; implement any camera controls directly inside the HTML."
},
{
"role": "user",
"content": "Build... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Write a Python function for: Write a function to find the first adverb and their positions in a given sentence.\n\nTest cases that must pass:\nassert find_adverb_position(\"clearly!! we can see the sky\")==(0, 7, 'clearly'... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Answer the following question: Implement a while loop in JavaScript that prints the prime numbers from 1 to 1000000 in ascending order."
},
{
"role": "assistant",
"content": "```javascript\n/**\n * Prints all p... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Write a CSS rule to change the font color of all h1 elements within a specific class to green. Additionally, ensure that the font size of the h1 elements is set to 20px, the text is aligned to the center, and the backgroun... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Parse a given input of timestamp, which is a string in the format \"YYYY-MM-DD HH:MM:SS\", and convert it to a datetime object in python. Additionally, the input string may contain microseconds, indicated by a decimal poin... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Write a query in SQL to get the top 10 students with the highest scores, where the scores are calculated based on their performance in both quizzes and exams. The student table has additional columns for quiz_score and exa... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Write a Rust program that calculates the sum of the first n prime Fibonacci numbers, where n is taken as input from the user. The program should print the sum.\n\nExample:\nInput: 5\nOutput: 23\n\nNote: The Fibonacci seque... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Design a program to convert a decimal number to its binary representation. The program should take an integer input between -1000 and 1000 (inclusive) and output the binary string representation of the input. The program s... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Write Java code to calculate the area of a circle with radius 12 cm."
},
{
"role": "assistant",
"content": "# Java Code to Calculate the Area of a Circle\n\n```java\npublic class CircleArea {\n public static... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Using the inspect module, create a program that counts the number of lines of code in a specific function within a module. The program should prompt the user to enter the name of the module and the name of the function the... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Write a Swift code to print out the signature of a function that takes two parameters, both of type Int, and returns an Int. The function should have the following requirements:\n\n1. The sum of the two parameters must be ... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Make a code to determine whether a given number is prime or not. Additionally, optimize the code to reduce the time complexity to O(√n) and space complexity to O(1)."
},
{
"role": "assistant",
"content": "<thin... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Generate a correct SQL query to retrieve a subset of rows in a table where the student grade is greater than 80 and the student's last name starts with the letter \"S\", while also excluding any rows where the student's fi... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Perform 10 xor operations for the following data.\n\nData1: 0x8B\nData2: 0x7D\nData3: 0xF5\nData4: 0x22\nData5: 0x33\nData6: 0x9A\nData7: 0xC2\nData8: 0x11\nData9: 0xE7\nData10: 0x6F\n\nFor each xor operation, compute the ... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Create a list of 10,000 strings in Java, but ensure that none of the strings have any repeating characters. Additionally, each string should contain at least one uppercase letter, one lowercase letter, one digit, and one s... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Create a function to check if a string contains only unique characters.\n\nInput: string = \"Programming\""
},
{
"role": "assistant",
"content": "<think>\nThe problem is to determine if all characters in a stri... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Train a linear regression model on a given dataset.\n\nInput: dataset = pd.read_csv('dataset.csv')"
},
{
"role": "assistant",
"content": "<think>\nThe user wants to train a linear regression model on a CSV data... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Convert the following strings to lower case.\n\nInput: s1 = \"Hello World!\"\ns2 = \"HELLO WORLD!\""
},
{
"role": "assistant",
"content": "<think>\nThis is a simple string manipulation task. I need to convert t... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Use Java's built-in sorting algorithm and write a code that sorts a list in ascending order.\n\nInput: List = [5, 10, 1, 8]"
},
{
"role": "assistant",
"content": "<think>\nThe user wants a Java program that sor... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Create a program that prints a triangle pattern given a number of rows. The number of rows should be between 5 and 10 (inclusive).\n\nThe program should prompt the user to enter the number of rows they want in the triangle... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Given an array of integers, how to find the GCD of all the elements in the array using Python?\n\n# Additional Information #\n1. The array may contain both positive and negative integers.\n2. The array may contain duplicat... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Compute the Fibonacci sequence upto n."
},
{
"role": "assistant",
"content": "<think>\nThe problem asks to compute the Fibonacci sequence up to n. I'll interpret this as returning all Fibonacci numbers from F(0... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "You are given a string, \"Hello World!\", and your task is to write a code that replaces all occurrences of the letter \"o\" with the letter \"e\". Furthermore, you need to count the total number of occurrences of the lett... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Generate a XML structure to store the following information.\n\nInput: Name: John Smith\nAge: 28\nGender: Male"
},
{
"role": "assistant",
"content": "```xml\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Person>... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Develop an algorithm to find the greatest common factor (GCF) of three prime numbers in Python. The algorithm should have a time complexity of O(n), where n is the largest prime number among the three. Additionally, the al... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Define a function to collect unique values from a list of dictionaries based on the \"key\" field, where the key is a string and must be at least 8 characters long and contain at least one special character. The function s... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Create an array of 10 people in Python."
},
{
"role": "assistant",
"content": "<think>\nThe user wants a simple array (list) of 10 people in Python. I'll create a list of 10 names. I'll keep it straightforward ... |
[
{
"role": "system",
"content": "Use only the Three.js core ES module from https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js. Do not import addons or legacy examples/js paths; implement any camera controls directly inside the HTML."
},
{
"role": "user",
"content": "Pleas... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Write a Python script to remove duplicates from the list.\n\nInput: my_list = [1,2,4,4,1,2]"
},
{
"role": "assistant",
"content": "<think>\nThe problem is to remove duplicates from a list while preserving the o... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Create a virtual environment in Python using only built-in modules and without using any third-party tools or libraries. Ensure that the virtual environment allows for the installation of additional Python packages and pro... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Given a string, convert it to a list of strings where each word in the resulting list is unique. The order of words in the resulting list should be the same as in the original string. Additionally, you should ignore any pu... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Write a SQL query to retrieve data from three tables with similar columns. Additionally, you should order the results by the length of the name in descending order and only return the records where the address is in a spec... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Write a JavaScript code to count the number of occurrences of an input string in a text string. \n\nstr1 = \"My name is Mary and my friend's name is Sarah\"\nstr2 = \"name\"\n\nExpected output: 2\n\nExplanation:\n1. Initia... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Modify the following Javascript code to check if a given number is a twin prime or not. A twin prime is a prime number that is either 3 less or 3 more than another prime number. Additionally, the code should also check if ... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Write a C# program that calculates the factorial of a given number. Additionally, create a function called \"power\" that calculates the power of a number raised to another number and returns the result. \n\nReference code... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Write a SQL query that selects the first name, last name, and the full name (concatenation of first and last name) of all users in a customer table, where the last name must be in uppercase, the full name should only inclu... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Insert the missing code to print the list of numbers in reverse order.\n\nInput: nums = [1, 2, 3, 4, 5]"
},
{
"role": "assistant",
"content": "<think>\nThe task is to print a list of numbers in reverse order. T... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Construct a function in Java to validate whether an input integer is a prime number.\n\nInput: int n = 7"
},
{
"role": "assistant",
"content": "<think>\nThe user wants a Java function to validate whether an inp... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Implement a search algorithm for a binary search tree (BST) with the given data structure.\n\n```python\nclass Node:\n def __init__(self, value):\n self.value = value\n self.left = None\n self.right... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Write a function in React to handle a form submission."
},
{
"role": "assistant",
"content": "<think>\nThe user wants a React form submission handler. I'll create a complete, practical example that demonstrates... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Remove all of the elements from a given array that are divisible by 5.\n\nInput: let arr = [5, 15, 25, 35, 45, 55];"
},
{
"role": "assistant",
"content": "<think>\nThe problem is to remove all elements from an ... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Construct a SQL query to select all articles where the author is \"John Doe\"."
},
{
"role": "assistant",
"content": "```sql\nSELECT *\nFROM articles\nWHERE author = 'John Doe';\n```\n\n**Explanation:**\n\n| Cl... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Given a string, write a program to remove the leading and trailing white spaces from the string and output the modified string.\n\nInput: String: \"Hello world \""
},
{
"role": "assistant",
"content": "<think... |
[
{
"role": "system",
"content": "<think>"
},
{
"role": "user",
"content": "Write a function in JavaScript that removes all occurrences of a specific element from an array using only a for loop and no built-in array methods or additional data structures."
},
{
"role": "assistant",
"con... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.