instruction stringlengths 14 5.13k | messages listlengths 2 2 | generator stringclasses 1
value | reasoning stringclasses 1
value | synthetic_model stringclasses 1
value | thinking_disabled bool 1
class |
|---|---|---|---|---|---|
Create a program to check if a given string is a palindrome. The string may contain uppercase and lowercase letters, numbers, and special characters. The program should ignore any spaces or punctuation marks and only consider the alphanumeric characters in the string. The program should also handle strings with a lengt... | [
{
"role": "user",
"content": "Create a program to check if a given string is a palindrome. The string may contain uppercase and lowercase letters, numbers, and special characters. The program should ignore any spaces or punctuation marks and only consider the alphanumeric characters in the string. The progr... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Edit the program to print the given date in the format "dd/mm/yyyy hh:mm:ss". However, you are not allowed to use any built-in date/time functions or libraries to convert the string format. You must manually extract the year, month, day, hour, minute, and second from the "date" variable and then print them in the desir... | [
{
"role": "user",
"content": "Edit the program to print the given date in the format \"dd/mm/yyyy hh:mm:ss\". However, you are not allowed to use any built-in date/time functions or libraries to convert the string format. You must manually extract the year, month, day, hour, minute, and second from the \"da... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Change the following code snippet to generate a random floating-point number from -1000 to 1000, and then round it to the nearest multiple of 100. After rounding, convert the result to an integer and store it in a variable named "roundedNumber". Finally, print the value of "roundedNumber" to the console.
Here's an exa... | [
{
"role": "user",
"content": "Change the following code snippet to generate a random floating-point number from -1000 to 1000, and then round it to the nearest multiple of 100. After rounding, convert the result to an integer and store it in a variable named \"roundedNumber\". Finally, print the value of \"... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a Python code snippet to print the pyramid structure with the given number of lines, where each line consists of consecutive prime numbers. Additionally, each line must be arranged in descending order of the prime numbers. | [
{
"role": "user",
"content": "Write a Python code snippet to print the pyramid structure with the given number of lines, where each line consists of consecutive prime numbers. Additionally, each line must be arranged in descending order of the prime numbers."
},
{
"role": "assistant",
"content":... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Construct a for loop to iterate through an array of numbers and print each prime number while skipping non-prime numbers.
var nums = [1,2,3,4,5,6,7,8,9,10]
Provide a piece of erroneous code as a reference to increase misdirection:
for (var i = 0; i < nums.length; i++) {
if (nums[i] === 2 || nums[i] === 3 || num... | [
{
"role": "user",
"content": "Construct a for loop to iterate through an array of numbers and print each prime number while skipping non-prime numbers. \n\nvar nums = [1,2,3,4,5,6,7,8,9,10]\n\nProvide a piece of erroneous code as a reference to increase misdirection:\n\nfor (var i = 0; i < nums.length; i++)... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Implement a function in JavaScript to calculate the median of all elements in an array. The array may contain positive and negative integers, as well as decimal numbers. The length of the array can vary from 1 to 1,000,000 elements. Your solution should have a time complexity of O(n log n) and a space complexity of O(1... | [
{
"role": "user",
"content": "Implement a function in JavaScript to calculate the median of all elements in an array. The array may contain positive and negative integers, as well as decimal numbers. The length of the array can vary from 1 to 1,000,000 elements. Your solution should have a time complexity o... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a code to multiply two decimal numbers without using the multiplication operator. Additionally, you are not allowed to use any looping constructs (e.g. for loop, while loop) or any built-in functions or methods that directly perform multiplication.
Furthermore, you are now required to handle negative decimal num... | [
{
"role": "user",
"content": "Write a code to multiply two decimal numbers without using the multiplication operator. Additionally, you are not allowed to use any looping constructs (e.g. for loop, while loop) or any built-in functions or methods that directly perform multiplication.\n\nFurthermore, you are... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Compare two integers and print the larger one. Additionally, print a message stating whether the larger number is a prime number or not. The program should also handle the case when the two numbers are equal, printing a message stating that the numbers are equal. Finally, the program should check if the larger number i... | [
{
"role": "user",
"content": "Compare two integers and print the larger one. Additionally, print a message stating whether the larger number is a prime number or not. The program should also handle the case when the two numbers are equal, printing a message stating that the numbers are equal. Finally, the p... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a query for filtering an array of objects in a MongoDB collection by their 'age' field. The collection is named 'users' and the filter should return objects with age greater than or equal to 18 and a 'gender' field that is not equal to 'female'. Additionally, the query should return objects that have a 'hobbies' ... | [
{
"role": "user",
"content": "Write a query for filtering an array of objects in a MongoDB collection by their 'age' field. The collection is named 'users' and the filter should return objects with age greater than or equal to 18 and a 'gender' field that is not equal to 'female'. Additionally, the query sh... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a HTML code that creates a form for users to fill out their current address. The form should include the following fields: first name, last name, email address, phone number, street address, city, state, and zip code. Additionally, the form should include validation to ensure that all fields are filled out correc... | [
{
"role": "user",
"content": "Write a HTML code that creates a form for users to fill out their current address. The form should include the following fields: first name, last name, email address, phone number, street address, city, state, and zip code. Additionally, the form should include validation to en... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a function to calculate the maximum of three numbers. Your solution should not use any built-in functions or operators for comparison, sorting, or mathematical operations (such as addition, subtraction, multiplication, or division). | [
{
"role": "user",
"content": "Create a function to calculate the maximum of three numbers. Your solution should not use any built-in functions or operators for comparison, sorting, or mathematical operations (such as addition, subtraction, multiplication, or division)."
},
{
"role": "assistant",
... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a code to convert a given spreadsheet in CSV format to JSON format. The code should handle large datasets efficiently, with a maximum file size of 10GB. Additionally, the code should validate the CSV data to ensure that all columns have the correct data type (e.g. integers, floats, dates), handle any errors or in... | [
{
"role": "user",
"content": "Write a code to convert a given spreadsheet in CSV format to JSON format. The code should handle large datasets efficiently, with a maximum file size of 10GB. Additionally, the code should validate the CSV data to ensure that all columns have the correct data type (e.g. integer... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a JavaScript function to validate a given URL and check if it contains a valid domain name. Additionally, the function should also check if the URL is using a secure protocol (https) and if it includes any query parameters. The function should also implement a rate limiting mechanism to limit the number of URL va... | [
{
"role": "user",
"content": "Write a JavaScript function to validate a given URL and check if it contains a valid domain name. Additionally, the function should also check if the URL is using a secure protocol (https) and if it includes any query parameters. The function should also implement a rate limiti... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a multithreaded program that finds all the prime numbers less than or equal to a given number, but the program should now use a minimum of four threads instead of two to divide the workload. Additionally, implement a user interface that allows the user to input the number and view the generated prime numbers in ... | [
{
"role": "user",
"content": "Create a multithreaded program that finds all the prime numbers less than or equal to a given number, but the program should now use a minimum of four threads instead of two to divide the workload. Additionally, implement a user interface that allows the user to input the numbe... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Construct a regular expression to extract all words from a given string that start with a specific letter and contain at least two uppercase letters. The specific letter should be case-sensitive and the extracted words should be in uppercase.
input_str = "The Quick BROWN Fox JUMPED Over the lazy DOG" | [
{
"role": "user",
"content": "Construct a regular expression to extract all words from a given string that start with a specific letter and contain at least two uppercase letters. The specific letter should be case-sensitive and the extracted words should be in uppercase.\n\ninput_str = \"The Quick BROWN Fo... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a C++ function to find the maximum element in an array of integers. The function should handle negative numbers and return the maximum element as an integer.
You should implement the function using a divide-and-conquer approach. Divide the array into two halves and recursively find the maximum element in each ha... | [
{
"role": "user",
"content": "Write a C++ function to find the maximum element in an array of integers. The function should handle negative numbers and return the maximum element as an integer.\n\nYou should implement the function using a divide-and-conquer approach. Divide the array into two halves and rec... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a code to generate the multiplication table of two given integers, x and y, where both x and y are positive integers greater than 1 and y is greater than x.
1. Prompt the user to enter a positive integer greater than 1 for x.
2. Validate the input to ensure it is a positive integer greater than 1. If not, prompt... | [
{
"role": "user",
"content": "Write a code to generate the multiplication table of two given integers, x and y, where both x and y are positive integers greater than 1 and y is greater than x.\n\n1. Prompt the user to enter a positive integer greater than 1 for x.\n2. Validate the input to ensure it is a po... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a code to check whether a given year is a leap year or not and find the number of leap years between a given range of years. Additionally, calculate the average number of leap years per decade within the given range.
To solve the problem, follow these steps:
1. Take the input range of years from the user.
2. Cr... | [
{
"role": "user",
"content": "Write a code to check whether a given year is a leap year or not and find the number of leap years between a given range of years. Additionally, calculate the average number of leap years per decade within the given range.\n\nTo solve the problem, follow these steps:\n\n1. Take... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Given a string consisting of words separated by commas, reverse the order of the words and return the modified string. The input string will contain at most 100 words and each word will contain at most 50 characters. The output string should maintain the original capitalization of the words.
Example:
Input: "Hello,Wor... | [
{
"role": "user",
"content": "Given a string consisting of words separated by commas, reverse the order of the words and return the modified string. The input string will contain at most 100 words and each word will contain at most 50 characters. The output string should maintain the original capitalization... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a JavaScript code to print the first 1000 terms of the Fibonacci series, but exclude any terms that are divisible by both 3 and 5. Additionally, calculate and print the sum of the remaining terms. | [
{
"role": "user",
"content": "Write a JavaScript code to print the first 1000 terms of the Fibonacci series, but exclude any terms that are divisible by both 3 and 5. Additionally, calculate and print the sum of the remaining terms."
},
{
"role": "assistant",
"content": "Sure! Here's a JavaScrip... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Implement a sentiment analysis model that accurately classifies the sentiment of the given sentence, taking into account various factors such as sarcasm, irony, and subtle nuances that may affect the sentiment classification. The model should incorporate a machine learning algorithm and demonstrate high accuracy in sen... | [
{
"role": "user",
"content": "Implement a sentiment analysis model that accurately classifies the sentiment of the given sentence, taking into account various factors such as sarcasm, irony, and subtle nuances that may affect the sentiment classification. The model should incorporate a machine learning algo... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Construct a regular expression to check if a string begins with a given substring, ends with a specific word, contains a specific number of digits in between, and all letters in the string are in uppercase. | [
{
"role": "user",
"content": "Construct a regular expression to check if a string begins with a given substring, ends with a specific word, contains a specific number of digits in between, and all letters in the string are in uppercase."
},
{
"role": "assistant",
"content": "To construct a **reg... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a code to remove the oldest elements from a list until the list contains at most 100 unique elements. The list initially contains 1000 elements.
The elements in the list are integers, and they are not in sequential order. The elements are randomly generated and can have duplicate values.
The code should remove... | [
{
"role": "user",
"content": "Write a code to remove the oldest elements from a list until the list contains at most 100 unique elements. The list initially contains 1000 elements.\n\nThe elements in the list are integers, and they are not in sequential order. The elements are randomly generated and can hav... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a MongoDB query for finding a record in the collection 'books' that contains a specific value for a given field and satisfies the following additional constraints: the title field must start with a capital letter, the author's name must contain the letter 'a' and the publication date must be after January 1st, 2... | [
{
"role": "user",
"content": "Create a MongoDB query for finding a record in the collection 'books' that contains a specific value for a given field and satisfies the following additional constraints: the title field must start with a capital letter, the author's name must contain the letter 'a' and the pub... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Convert the following strings to lower case and count the number of vowels in each string. The input strings may contain punctuation marks, special characters, and multiple spaces between words.
s1 = "Hello World!"
s2 = "HELLO WORLD!!!"
Time Complexity Requirement: O(n)
Space Complexity Requirement: O(1) | [
{
"role": "user",
"content": "Convert the following strings to lower case and count the number of vowels in each string. The input strings may contain punctuation marks, special characters, and multiple spaces between words.\ns1 = \"Hello World!\"\ns2 = \"HELLO WORLD!!!\"\n\nTime Complexity Requirement... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a program which will take the user's full name (including first name, middle name, and last name) and output a custom message depending on the supplied name. The custom message should be generated based on the following criteria:
- If the first name starts with a vowel and has more than 3 characters, and the las... | [
{
"role": "user",
"content": "Create a program which will take the user's full name (including first name, middle name, and last name) and output a custom message depending on the supplied name. The custom message should be generated based on the following criteria:\n- If the first name starts with a vowel ... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Construct a query in SQL to find the names of the customers who made a purchase on a given date, spent more than $100, and purchased at least 5 items. The table name is 'Orders', the given date is '2020-06-25', and the customer names should be ordered in descending order of their total purchase amount.
Provide a piece... | [
{
"role": "user",
"content": "Construct a query in SQL to find the names of the customers who made a purchase on a given date, spent more than $100, and purchased at least 5 items. The table name is 'Orders', the given date is '2020-06-25', and the customer names should be ordered in descending order of the... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
You are given a list of integers. Your task is to convert the given list to a set while ensuring that the resulting set is sorted in descending order. Additionally, the elements in the set should be unique and greater than 1. Finally, the program should output the sum of all the elements in the set.
Write a function n... | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to convert the given list to a set while ensuring that the resulting set is sorted in descending order. Additionally, the elements in the set should be unique and greater than 1. Finally, the program should output the sum of all th... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Find the index of the given word in the sentence. The sentence should contain at least 15 words and should not exceed a maximum length of 150 characters. The word should only be considered a match if it appears as a complete word, not as part of another word. Additionally, the word should be case-insensitive when compa... | [
{
"role": "user",
"content": "Find the index of the given word in the sentence. The sentence should contain at least 15 words and should not exceed a maximum length of 150 characters. The word should only be considered a match if it appears as a complete word, not as part of another word. Additionally, the ... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Normalize a given array of positive integers such that it adds up to the nearest prime number greater than the sum of all elements in the array. The array can have duplicate elements and can be of any length greater than or equal to 2. The input array will always have at least one prime number. The elements in the arra... | [
{
"role": "user",
"content": "Normalize a given array of positive integers such that it adds up to the nearest prime number greater than the sum of all elements in the array. The array can have duplicate elements and can be of any length greater than or equal to 2. The input array will always have at least ... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a recursive algorithm to generate the Fibonacci series up to the nth term. Additionally, implement a memoization technique to optimize the algorithm's performance. The memoization technique should use a custom data structure instead of a built-in data structure like a dictionary or hashmap. The custom data struct... | [
{
"role": "user",
"content": "Write a recursive algorithm to generate the Fibonacci series up to the nth term. Additionally, implement a memoization technique to optimize the algorithm's performance. The memoization technique should use a custom data structure instead of a built-in data structure like a dic... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Print the first 10 elements of the following list in reverse order, skipping any even numbers.
my_list = [2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30]
#Reasoning Steps#
1. Create an empty list called "reversed_list" to store the reversed elements.
2. Iterate over the "my_list" starting from the last element... | [
{
"role": "user",
"content": "Print the first 10 elements of the following list in reverse order, skipping any even numbers.\nmy_list = [2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30]\n\n#Reasoning Steps#\n1. Create an empty list called \"reversed_list\" to store the reversed elements.\n2. Iterate ... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Classify whether the following is an imperative or functional programming language. Also, provide at least five characteristics of the language that support your classification. Additionally, identify and correct any errors in the given code snippet.
Java
Erroneous code snippet:
```java
public class MyProgram {
p... | [
{
"role": "user",
"content": "Classify whether the following is an imperative or functional programming language. Also, provide at least five characteristics of the language that support your classification. Additionally, identify and correct any errors in the given code snippet.\n\nJava\n\nErroneous code s... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Please write a Python function that takes in two strings as parameters and returns True if the first string is an anagram of the second string, and False otherwise.
An anagram is a word or phrase formed by rearranging the letters of another word or phrase. For example, "listen" and "silent" are anagrams.
The function... | [
{
"role": "user",
"content": "Please write a Python function that takes in two strings as parameters and returns True if the first string is an anagram of the second string, and False otherwise.\n\nAn anagram is a word or phrase formed by rearranging the letters of another word or phrase. For example, \"lis... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a function to reverse a string in-place (i.e., without using any extra space) while also ensuring that all characters are shifted to their next lexicographically greater character. The function should handle both uppercase and lowercase letters. The reversed string should have all vowels capitalized and all cons... | [
{
"role": "user",
"content": "Create a function to reverse a string in-place (i.e., without using any extra space) while also ensuring that all characters are shifted to their next lexicographically greater character. The function should handle both uppercase and lowercase letters. The reversed string shoul... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a function that sorts the given list of numbers and strings in descending order, but without using any built-in sorting functions or libraries. The function should also handle duplicate numbers in the list and sort them based on their original positions. Additionally, the function should be able to handle lists t... | [
{
"role": "user",
"content": "Write a function that sorts the given list of numbers and strings in descending order, but without using any built-in sorting functions or libraries. The function should also handle duplicate numbers in the list and sort them based on their original positions. Additionally, the... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Modify the following for loop to loop backwards. The loop should start from the last element of the array and decrement the index until it reaches the first element. Print out the value of each element in the reversed order. Additionally, calculate the sum of all the values in the reversed order and print it out at the... | [
{
"role": "user",
"content": "Modify the following for loop to loop backwards. The loop should start from the last element of the array and decrement the index until it reaches the first element. Print out the value of each element in the reversed order. Additionally, calculate the sum of all the values in ... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
## Problem
Implement a function `merge_arrays` that takes in two sorted arrays `arr1` and `arr2` and returns a new sorted array that contains all the elements from both `arr1` and `arr2`.
The function should have a time complexity of O(n), where n is the total number of elements in both arrays. Additionally, the func... | [
{
"role": "user",
"content": "## Problem\n\nImplement a function `merge_arrays` that takes in two sorted arrays `arr1` and `arr2` and returns a new sorted array that contains all the elements from both `arr1` and `arr2`.\n\nThe function should have a time complexity of O(n), where n is the total number of e... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a Python program to generate an ASCII art representation of a given word in a specific font style. The program should prompt the user to enter a word and a font style. It should then generate and display the ASCII art representation of the word using the chosen font style.
The program should handle various font ... | [
{
"role": "user",
"content": "Write a Python program to generate an ASCII art representation of a given word in a specific font style. The program should prompt the user to enter a word and a font style. It should then generate and display the ASCII art representation of the word using the chosen font style... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a function to convert a given number from decimal to binary representation using Python. The function should not use any built-in functions or libraries for converting decimal to binary. The input number can be any positive integer, including numbers greater than 1000. | [
{
"role": "user",
"content": "Create a function to convert a given number from decimal to binary representation using Python. The function should not use any built-in functions or libraries for converting decimal to binary. The input number can be any positive integer, including numbers greater than 1000."
... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a MySQL table 'employees' with columns name, age, department, salary, hire date, and employee ID. Additionally, include a primary key for the table.
Ensure that the name column only allows values that are not null and have a maximum length of 50 characters. The names should also be stored in uppercase.
The age... | [
{
"role": "user",
"content": "Create a MySQL table 'employees' with columns name, age, department, salary, hire date, and employee ID. Additionally, include a primary key for the table.\n\nEnsure that the name column only allows values that are not null and have a maximum length of 50 characters. The names ... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a Python code to calculate the sum of natural numbers up to n, but without using any loops, recursion, or built-in functions like sum() or range(). Additionally, the code should only use a maximum of 3 lines of code. | [
{
"role": "user",
"content": "Write a Python code to calculate the sum of natural numbers up to n, but without using any loops, recursion, or built-in functions like sum() or range(). Additionally, the code should only use a maximum of 3 lines of code."
},
{
"role": "assistant",
"content": "Here... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a code to add two linked lists of different sizes, where each node contains multiple digits and the digits are stored in reverse order. The resulting sum should also be stored in a linked list in reverse order.
The linked lists can have a maximum of 5 digits in each node.
list1 = [99->99->99->99->99]
list2 = [1... | [
{
"role": "user",
"content": "Write a code to add two linked lists of different sizes, where each node contains multiple digits and the digits are stored in reverse order. The resulting sum should also be stored in a linked list in reverse order.\n\nThe linked lists can have a maximum of 5 digits in each no... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a program to generate the sum of all the elements in a given list, but with the following constraints:
1. The program should only use bitwise operations (e.g., bit shifting, bitwise AND/OR/XOR) to perform the addition operation.
2. The program should handle large input lists with billions or trillions of element... | [
{
"role": "user",
"content": "Create a program to generate the sum of all the elements in a given list, but with the following constraints:\n1. The program should only use bitwise operations (e.g., bit shifting, bitwise AND/OR/XOR) to perform the addition operation.\n2. The program should handle large input... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a function that finds the longest substring that appears at least k times in a given string. The function should have a time complexity of O(n), where n is the length of the input string, and you should not use any built-in functions or libraries that directly solve this problem.
Additionally, you should impleme... | [
{
"role": "user",
"content": "Write a function that finds the longest substring that appears at least k times in a given string. The function should have a time complexity of O(n), where n is the length of the input string, and you should not use any built-in functions or libraries that directly solve this ... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a CSS style to set the background color of a div class "sample" to a random color from a pre-defined list of colors. Additionally, the background color should change every time the page is refreshed or the div is clicked. However, the random color generated should be a light shade, meaning it should have a high ... | [
{
"role": "user",
"content": "Create a CSS style to set the background color of a div class \"sample\" to a random color from a pre-defined list of colors. Additionally, the background color should change every time the page is refreshed or the div is clicked. However, the random color generated should be a... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a Python function to create a two-dimensional array of specified dimensions, ensuring that all elements in the array are unique, in ascending order, and are prime numbers.
## Constraints:
- The function should have a time complexity of O(n) or better, where n is the total number of elements in the array.
- The f... | [
{
"role": "user",
"content": "Write a Python function to create a two-dimensional array of specified dimensions, ensuring that all elements in the array are unique, in ascending order, and are prime numbers.\n\n## Constraints:\n- The function should have a time complexity of O(n) or better, where n is the t... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a Python program to find the maximum value in the given array. However, you are not allowed to use any built-in functions or libraries to find the maximum value. You must implement your own algorithm to solve this problem. The array will contain only positive integers. Additionally, your algorithm should have a ... | [
{
"role": "user",
"content": "Create a Python program to find the maximum value in the given array. However, you are not allowed to use any built-in functions or libraries to find the maximum value. You must implement your own algorithm to solve this problem. The array will contain only positive integers. A... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Please write code to implement the Odd-Even Sort algorithm.
Additional requirements:
- The sorting algorithm should be implemented as a function.
- The function should take an array of integers as input and return the sorted array.
- The function should handle arrays of any length.
- The function should handle arrays ... | [
{
"role": "user",
"content": "Please write code to implement the Odd-Even Sort algorithm.\n\nAdditional requirements:\n- The sorting algorithm should be implemented as a function.\n- The function should take an array of integers as input and return the sorted array.\n- The function should handle arrays of a... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Implement a function that converts a given decimal number into its binary representation using Python. The function should return a string representation of the binary number.
Constraints:
- The decimal number is a positive integer.
- The decimal number is less than or equal to 10^18.
Example:
Input: 987654321
Output... | [
{
"role": "user",
"content": "Implement a function that converts a given decimal number into its binary representation using Python. The function should return a string representation of the binary number.\n\nConstraints:\n- The decimal number is a positive integer.\n- The decimal number is less than or equ... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Find the top 10 most common words in a given string, while also excluding any common stop words such as "the", "and", "a", "is", etc. Additionally, ensure that the solution runs in O(nlogn) time complexity, where n is the length of the input string.
#Explanation#
The original problem already provides a clear objective... | [
{
"role": "user",
"content": "Find the top 10 most common words in a given string, while also excluding any common stop words such as \"the\", \"and\", \"a\", \"is\", etc. Additionally, ensure that the solution runs in O(nlogn) time complexity, where n is the length of the input string.\n\n#Explanation#\nTh... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Reorder a given array in specialized order while maintaining the relative order of prime and non-prime numbers. Additionally, you need to implement the reordering algorithm in such a way that it has a time complexity of O(n), where n is the size of the input array. | [
{
"role": "user",
"content": "Reorder a given array in specialized order while maintaining the relative order of prime and non-prime numbers. Additionally, you need to implement the reordering algorithm in such a way that it has a time complexity of O(n), where n is the size of the input array."
},
{
... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a Python function that takes in two lists of integers and returns a new list containing only the common elements between the two input lists. The function should have a time complexity of O(nlogn), where n is the length of the longer input list.
list1 = [1, 2, 3, 5, 7, 9, 10, 11, 12]
list2 = [2, 3, 4, 5, 6, 8, 9... | [
{
"role": "user",
"content": "Write a Python function that takes in two lists of integers and returns a new list containing only the common elements between the two input lists. The function should have a time complexity of O(nlogn), where n is the length of the longer input list.\n\nlist1 = [1, 2, 3, 5, 7,... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create an HTML page displaying a table of 8 rows and 10 columns. Each cell should contain a unique number from 1 to 80. The numbers should be randomly shuffled and distributed evenly throughout the table. The table should have alternating background colors for each row, with the first row having a light background colo... | [
{
"role": "user",
"content": "Create an HTML page displaying a table of 8 rows and 10 columns. Each cell should contain a unique number from 1 to 80. The numbers should be randomly shuffled and distributed evenly throughout the table. The table should have alternating background colors for each row, with th... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a JavaScript function that takes a given paragraph as a parameter and capitalizes the first letter of each sentence. Additionally, the function should ignore any sentences that contain numbers or special characters. The paragraph should be at least 10 sentences long and the function should not use any built-in s... | [
{
"role": "user",
"content": "Create a JavaScript function that takes a given paragraph as a parameter and capitalizes the first letter of each sentence. Additionally, the function should ignore any sentences that contain numbers or special characters. The paragraph should be at least 10 sentences long and ... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Implement a function that calculates the Big O notation for a given algorithm's time complexity. The algorithm must be a combination of both recursive and iterative approaches. The function should also take into account any nested loops within the algorithm. Return a string representation of the result. | [
{
"role": "user",
"content": "Implement a function that calculates the Big O notation for a given algorithm's time complexity. The algorithm must be a combination of both recursive and iterative approaches. The function should also take into account any nested loops within the algorithm. Return a string rep... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a JavaScript code to eliminate any symbols, numbers, and whitespace characters from a given string, while retaining the order of the remaining characters. Additionally, convert all uppercase letters to lowercase, remove any duplicate characters from the resulting string, and reverse the order of the characters in... | [
{
"role": "user",
"content": "Write a JavaScript code to eliminate any symbols, numbers, and whitespace characters from a given string, while retaining the order of the remaining characters. Additionally, convert all uppercase letters to lowercase, remove any duplicate characters from the resulting string, ... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a Python function to compute the maximum value for each key in a given dictionary, but only if the value is an integer, divisible by 3, and also contains a prime number in its prime factorization. If the value does not meet these conditions, return 0.
d = {'a': 12, 'b': 20, 'c': 30}
Note: You may assume that th... | [
{
"role": "user",
"content": "Write a Python function to compute the maximum value for each key in a given dictionary, but only if the value is an integer, divisible by 3, and also contains a prime number in its prime factorization. If the value does not meet these conditions, return 0.\n\nd = {'a': 12, 'b'... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a Java program to find the kth largest element in a given array of integers, where k is a user-inputted value between 1 and the length of the array. You are not allowed to use any built-in functions or libraries for sorting or finding the maximum value.
Additionally, you should optimize the solution to have a ti... | [
{
"role": "user",
"content": "Write a Java program to find the kth largest element in a given array of integers, where k is a user-inputted value between 1 and the length of the array. You are not allowed to use any built-in functions or libraries for sorting or finding the maximum value.\n\nAdditionally, y... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
What is the output of the following code in Python?
```python
def foo(n):
if n == 0:
return None
elif n == 1:
return "Hello"
else:
return 5
if foo(2) is None:
print("Result is None")
elif foo(2) == "Hello":
print("Result is Hello")
else:
print("Result is not None")
```
... | [
{
"role": "user",
"content": "What is the output of the following code in Python?\n\n```python\ndef foo(n):\n if n == 0:\n return None\n elif n == 1:\n return \"Hello\"\n else:\n return 5\n\nif foo(2) is None:\n print(\"Result is None\")\nelif foo(2) == \"Hello\":\n print... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a MySQL query to find the highest salary of each department, but exclude departments with less than 10 employees and only include departments where the average salary is greater than 100,000. | [
{
"role": "user",
"content": "Write a MySQL query to find the highest salary of each department, but exclude departments with less than 10 employees and only include departments where the average salary is greater than 100,000."
},
{
"role": "assistant",
"content": "To find the **highest salary ... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Edit the Java code to filter out the persons whose age is a prime number and whose name contains at least three consecutive vowels.
List<Person> persons = new ArrayList<>();
for (Person person : persons) {
if (isPrime(person.getAge()) && hasAtLeastThreeConsecutiveVowels(person.getName())) {
System.out.pri... | [
{
"role": "user",
"content": "Edit the Java code to filter out the persons whose age is a prime number and whose name contains at least three consecutive vowels. \nList<Person> persons = new ArrayList<>();\n\nfor (Person person : persons) {\n if (isPrime(person.getAge()) && hasAtLeastThreeConsecutiveVowe... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Explain how treemaps are used in data visualization to display hierarchical data and provide an example of Python code that generates a treemap using the squarify library. Additionally, implement a function that allows the user to customize the color scheme of the generated treemap based on a specific attribute of the ... | [
{
"role": "user",
"content": "Explain how treemaps are used in data visualization to display hierarchical data and provide an example of Python code that generates a treemap using the squarify library. Additionally, implement a function that allows the user to customize the color scheme of the generated tre... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a SQL query to find the names of customers who have ordered products and have made a purchase in the last 30 days. However, exclude customers who have placed an order for a specific product within the last 7 days and have also made a return for any product within the last 14 days. | [
{
"role": "user",
"content": "Write a SQL query to find the names of customers who have ordered products and have made a purchase in the last 30 days. However, exclude customers who have placed an order for a specific product within the last 7 days and have also made a return for any product within the last... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Using Python, create a function that takes in a string and checks if it contains at least one uppercase letter, one lowercase letter, one numeric digit, and one special character. Additionally, the function should return the number of uppercase letters found in the string. The function should handle the case when the i... | [
{
"role": "user",
"content": "Using Python, create a function that takes in a string and checks if it contains at least one uppercase letter, one lowercase letter, one numeric digit, and one special character. Additionally, the function should return the number of uppercase letters found in the string. The ... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a JS program that takes a number n and prints out the first n Fibonacci numbers in reverse order. Ensure that the program includes error handling for invalid input, such as non-numeric values or negative numbers.
Additionally, implement the program in a way that avoids calculating the Fibonacci numbers multiple ... | [
{
"role": "user",
"content": "Write a JS program that takes a number n and prints out the first n Fibonacci numbers in reverse order. Ensure that the program includes error handling for invalid input, such as non-numeric values or negative numbers.\n\nAdditionally, implement the program in a way that avoids... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write an algorithm to perform binary search on a sorted array that contains duplicate elements. The algorithm should find the last occurrence of a target element and return its index. If the target element is not present in the array, the algorithm should return -1. Ensure that the time complexity is O(log n) and the s... | [
{
"role": "user",
"content": "Write an algorithm to perform binary search on a sorted array that contains duplicate elements. The algorithm should find the last occurrence of a target element and return its index. If the target element is not present in the array, the algorithm should return -1. Ensure that... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a Python function to format a specified string to limit the number of characters to 6. The function should also replace any vowels in the string with the corresponding number (e.g. 'a' becomes '1', 'e' becomes '2', 'i' becomes '3', 'o' becomes '4', 'u' becomes '5'). Additionally, the function should check if the ... | [
{
"role": "user",
"content": "Write a Python function to format a specified string to limit the number of characters to 6. The function should also replace any vowels in the string with the corresponding number (e.g. 'a' becomes '1', 'e' becomes '2', 'i' becomes '3', 'o' becomes '4', 'u' becomes '5'). Addit... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a function that takes in a list of integers and returns the second largest number in the list. The function should have a time complexity of O(n), where n is the length of the list.
To achieve this, you can iterate through the list and keep track of the largest and second largest numbers encountered. Here are t... | [
{
"role": "user",
"content": "Create a function that takes in a list of integers and returns the second largest number in the list. The function should have a time complexity of O(n), where n is the length of the list.\n\nTo achieve this, you can iterate through the list and keep track of the largest and se... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Edit the following function so that it counts the prime numbers in the given array. The function should have a time complexity of O(n * sqrt(m)), where n is the length of the array and m is the maximum value in the array.
```python
def count_prime_numbers(arr):
count = 0
for num in arr:
if num < 2:
... | [
{
"role": "user",
"content": "Edit the following function so that it counts the prime numbers in the given array. The function should have a time complexity of O(n * sqrt(m)), where n is the length of the array and m is the maximum value in the array.\n\n```python\ndef count_prime_numbers(arr):\n count =... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a Python function to remove the characters which have odd index values of a given string, while also ignoring any punctuation marks present in the string. The function should return the modified string. Additionally, the function should handle the case where the given string contains leading or trailing whitespac... | [
{
"role": "user",
"content": "Write a Python function to remove the characters which have odd index values of a given string, while also ignoring any punctuation marks present in the string. The function should return the modified string. Additionally, the function should handle the case where the given str... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Sort the following list of integers in descending order. The list may contain duplicates and have a length of up to 10^6. Implement an efficient algorithm that uses O(1) extra space and runs in O(n log n) time complexity, where n is the length of the list. Additionally, you are required to remove any duplicate elements... | [
{
"role": "user",
"content": "Sort the following list of integers in descending order. The list may contain duplicates and have a length of up to 10^6. Implement an efficient algorithm that uses O(1) extra space and runs in O(n log n) time complexity, where n is the length of the list. Additionally, you are... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Convert the following code from Swift to Java.
You are given a variable named "age" that is currently assigned the value of 25.
However, there is an error in the code. The current assignment statement tries to assign the string value "25" to the variable, instead of the integer value 25.
Your task is to fix the err... | [
{
"role": "user",
"content": "Convert the following code from Swift to Java.\n\nYou are given a variable named \"age\" that is currently assigned the value of 25. \n\nHowever, there is an error in the code. The current assignment statement tries to assign the string value \"25\" to the variable, instead of ... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a function to find the greatest common divisor of two numbers in Python without using any built-in functions or modules that directly calculate the greatest common divisor.
However, the function should now have a time complexity of O(log(min(a,b))) and space complexity of O(1), where 'a' and 'b' are the input n... | [
{
"role": "user",
"content": "Create a function to find the greatest common divisor of two numbers in Python without using any built-in functions or modules that directly calculate the greatest common divisor.\n\nHowever, the function should now have a time complexity of O(log(min(a,b))) and space complexit... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Increase the difficulty of the test by requiring the use of hooks instead of functional components.
#Rewritten Test#
Improve the following React component to render a link with the text "Visit us Here". When the link is clicked, it should display an alert with the message "You have visited us!".
```javascript
import ... | [
{
"role": "user",
"content": "Increase the difficulty of the test by requiring the use of hooks instead of functional components.\n\n#Rewritten Test#\nImprove the following React component to render a link with the text \"Visit us Here\". When the link is clicked, it should display an alert with the message... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a 'dockerfile' that includes instructions for installing a specific version of a software package and configuring it to run as a service in the background. Additionally, the software package should be installed from a non-standard source, such as a private repository or a specific URL. The 'dockerfile' must also ... | [
{
"role": "user",
"content": "Write a 'dockerfile' that includes instructions for installing a specific version of a software package and configuring it to run as a service in the background. Additionally, the software package should be installed from a non-standard source, such as a private repository or a... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Calculate the sum of all even prime numbers in a given list of positive integers using Python. The list should contain at least 15 elements and each element should be a prime number less than or equal to 100. Find the sum only if the list has more even prime numbers than odd prime numbers and the sum should be greater ... | [
{
"role": "user",
"content": "Calculate the sum of all even prime numbers in a given list of positive integers using Python. The list should contain at least 15 elements and each element should be a prime number less than or equal to 100. Find the sum only if the list has more even prime numbers than odd pr... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Given a list of numbers, find the minimum and maximum elements. However, you must do this without using any built-in functions or methods for finding the minimum and maximum. Additionally, you must optimize your solution to have a time complexity of O(n), where n is the length of the list. You are also required to hand... | [
{
"role": "user",
"content": "Given a list of numbers, find the minimum and maximum elements. However, you must do this without using any built-in functions or methods for finding the minimum and maximum. Additionally, you must optimize your solution to have a time complexity of O(n), where n is the length ... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
## Problem Statement
Write a function that finds the most frequent item in an array, but with the following constraints:
- The function should have a time complexity of O(n), where n is the length of the array.
- The function should not use any built-in sorting or counting functions/methods.
- The function should use... | [
{
"role": "user",
"content": "## Problem Statement\n\nWrite a function that finds the most frequent item in an array, but with the following constraints:\n\n- The function should have a time complexity of O(n), where n is the length of the array.\n- The function should not use any built-in sorting or counti... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a function to find the total area of a triangle, given its base, height, and the lengths of its three sides. The function should also check if the triangle is valid or not. A triangle is valid if the sum of the lengths of any two sides is greater than the length of the third side. The function should handle deci... | [
{
"role": "user",
"content": "Create a function to find the total area of a triangle, given its base, height, and the lengths of its three sides. The function should also check if the triangle is valid or not. A triangle is valid if the sum of the lengths of any two sides is greater than the length of the t... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a Python function to replace all the occurrences of a given substring with another, but with the following additional constraints:
1. The function should be case-insensitive, meaning it should replace occurrences of the substring regardless of whether they are in uppercase or lowercase.
2. The function should n... | [
{
"role": "user",
"content": "Write a Python function to replace all the occurrences of a given substring with another, but with the following additional constraints:\n\n1. The function should be case-insensitive, meaning it should replace occurrences of the substring regardless of whether they are in upper... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Determine the output of the given Python code.
x = [1, 2, 3, 4, 5]
y = x.copy()
y[4] = 6
What is the value of x after executing the code? | [
{
"role": "user",
"content": "Determine the output of the given Python code.\nx = [1, 2, 3, 4, 5] \ny = x.copy()\ny[4] = 6 \n\nWhat is the value of x after executing the code?"
},
{
"role": "assistant",
"content": "Let's analyze the given Python code step by step:\n\n```python\nx = [1, 2, 3, 4, ... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a code fragment to find the most frequent element in an array, excluding any elements that occur less than three times. The array must contain at least 20 elements and the output should be in descending order of frequency. Additionally, you should implement the solution in a single pass without using any addition... | [
{
"role": "user",
"content": "Write a code fragment to find the most frequent element in an array, excluding any elements that occur less than three times. The array must contain at least 20 elements and the output should be in descending order of frequency. Additionally, you should implement the solution i... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
What is data transformation, how is it used, and provide an implementation for a data transformation algorithm that converts a string into a hexadecimal number, considering edge cases and handling errors appropriately.
Write a function called `string_to_hex` that takes a string as input and returns the corresponding h... | [
{
"role": "user",
"content": "What is data transformation, how is it used, and provide an implementation for a data transformation algorithm that converts a string into a hexadecimal number, considering edge cases and handling errors appropriately.\n\nWrite a function called `string_to_hex` that takes a str... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Find the sum of the two smallest prime numbers whose difference is also a prime number and is divisible by 7, using C#.
The two prime numbers are: 3 and 5. | [
{
"role": "user",
"content": "Find the sum of the two smallest prime numbers whose difference is also a prime number and is divisible by 7, using C#. \nThe two prime numbers are: 3 and 5."
},
{
"role": "assistant",
"content": "Let's break down the problem:\n\nWe are to **find the sum of the two ... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write an SQL query to find the third highest salary of an employee in a given department, but exclude any employees whose salary is above the average salary of all employees in that department. Additionally, exclude any employees whose name starts with the letter 'A'. | [
{
"role": "user",
"content": "Write an SQL query to find the third highest salary of an employee in a given department, but exclude any employees whose salary is above the average salary of all employees in that department. Additionally, exclude any employees whose name starts with the letter 'A'."
},
{... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a function in Python to calculate the factorial of a number. Additionally, handle the case when the input is a floating-point number or a string that represents a number, and raise an exception with a custom error message.
Furthermore, implement the factorial function using recursion rather than iteration. | [
{
"role": "user",
"content": "Create a function in Python to calculate the factorial of a number. Additionally, handle the case when the input is a floating-point number or a string that represents a number, and raise an exception with a custom error message.\n\nFurthermore, implement the factorial function... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a C++ code to find the longest common substring in two strings, but the substring must be at least 5 characters long, contain at least one digit, be palindromic, and the characters in the substring must be in lexicographically increasing order. | [
{
"role": "user",
"content": "Write a C++ code to find the longest common substring in two strings, but the substring must be at least 5 characters long, contain at least one digit, be palindromic, and the characters in the substring must be in lexicographically increasing order."
},
{
"role": "assi... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Construct a switch statement to log different grade messages based on the grade variable. The grade variable can only contain the following values: "A+", "A", "B", "C", "D", "F". Additionally, each grade value should have a specific range associated with it as follows:
- "A+": 90-100
- "A": 85-89
- "B": 70-84
- "C": 5... | [
{
"role": "user",
"content": "Construct a switch statement to log different grade messages based on the grade variable. The grade variable can only contain the following values: \"A+\", \"A\", \"B\", \"C\", \"D\", \"F\". Additionally, each grade value should have a specific range associated with it as follo... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Construct a query in PostgreSQL to find the names and emails of all users who have "google.com" in their emails and whose names start with a vowel. Additionally, the query should sort the results in alphabetical order based on the users' names. Furthermore, only include users whose email addresses end with ".com". | [
{
"role": "user",
"content": "Construct a query in PostgreSQL to find the names and emails of all users who have \"google.com\" in their emails and whose names start with a vowel. Additionally, the query should sort the results in alphabetical order based on the users' names. Furthermore, only include users... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Sort the given list of numbers in ascending order using the bubble sort algorithm in Python. You are not allowed to use the built-in `sort()` function or any other sorting algorithm.
numbers = [3, 5, 7, 1, 2]
Provide a piece of erroneous code as a reference to increase misdirection:
```python
def bubble_sort(numbers... | [
{
"role": "user",
"content": "Sort the given list of numbers in ascending order using the bubble sort algorithm in Python. You are not allowed to use the built-in `sort()` function or any other sorting algorithm.\n\nnumbers = [3, 5, 7, 1, 2]\n\nProvide a piece of erroneous code as a reference to increase mi... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a program to parse a given string and return a dictionary with all the words and their frequency. The program should ignore any words that are less than 3 characters long or that contain any non-alphabetical characters. Additionally, the program should handle cases in a case-insensitive manner and count words wi... | [
{
"role": "user",
"content": "Create a program to parse a given string and return a dictionary with all the words and their frequency. The program should ignore any words that are less than 3 characters long or that contain any non-alphabetical characters. Additionally, the program should handle cases in a ... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a method in Java to return the largest prime number less than a given number. The method should have a time complexity of O(log(n)^2), where n is the given number. Additionally, the method should have a space complexity of O(1). The implementation should also ensure that the method does not use any built-in prim... | [
{
"role": "user",
"content": "Create a method in Java to return the largest prime number less than a given number. The method should have a time complexity of O(log(n)^2), where n is the given number. Additionally, the method should have a space complexity of O(1). The implementation should also ensure that... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a program in C++ that calculates the absolute difference between two numbers. The program should be able to handle large numbers up to 10^18. Additionally, the program should have a time complexity of O(log n), where n is the maximum number of digits in the input numbers.
In addition to the above requirements, ... | [
{
"role": "user",
"content": "Create a program in C++ that calculates the absolute difference between two numbers. The program should be able to handle large numbers up to 10^18. Additionally, the program should have a time complexity of O(log n), where n is the maximum number of digits in the input numbers... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Classify a given sentence based on the intention behind it, considering multiple possible intentions, complex grammatical structures, and potential ambiguity or conflicts in intentions.
The program should analyze the sentence and determine the intention behind it by considering various possibilities, such as expressin... | [
{
"role": "user",
"content": "Classify a given sentence based on the intention behind it, considering multiple possible intentions, complex grammatical structures, and potential ambiguity or conflicts in intentions.\n\nThe program should analyze the sentence and determine the intention behind it by consider... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Edit the original code snippet so that it prints "Hello, World!" 10 times in a row, with each repetition on a new line. Additionally, each line should be prefixed with the line number followed by a colon, starting from 1. The program should only use a single loop and must not use any additional print statements or vari... | [
{
"role": "user",
"content": "Edit the original code snippet so that it prints \"Hello, World!\" 10 times in a row, with each repetition on a new line. Additionally, each line should be prefixed with the line number followed by a colon, starting from 1. The program should only use a single loop and must not... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Define a function that takes a list of positive integers as input and returns a list of all odd numbers greater than 10 and less than 100, while also ensuring that the returned list is sorted in ascending order. The function should handle cases where the input list is empty and should raise a ValueError if any negative... | [
{
"role": "user",
"content": "Define a function that takes a list of positive integers as input and returns a list of all odd numbers greater than 10 and less than 100, while also ensuring that the returned list is sorted in ascending order. The function should handle cases where the input list is empty and... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Calculate the square root of the given number and round it to the nearest integer. The input number will always be a positive integer less than or equal to 10^9. The time complexity of your solution should be O(log(N)), where N is the input number. Additionally, your solution should be able to handle input numbers that... | [
{
"role": "user",
"content": "Calculate the square root of the given number and round it to the nearest integer. The input number will always be a positive integer less than or equal to 10^9. The time complexity of your solution should be O(log(N)), where N is the input number. Additionally, your solution s... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a SQL query to join two tables on a specified condition and display only the rows where the sum of the age and marks is greater than 100. Additionally, only include rows where the class in Table 2 is greater than 10.
Table 1:
id name age
1 a 15
2 b 18
3 c 20
Table 2:
id class marks
... | [
{
"role": "user",
"content": "Write a SQL query to join two tables on a specified condition and display only the rows where the sum of the age and marks is greater than 100. Additionally, only include rows where the class in Table 2 is greater than 10. \n\nTable 1:\nid name age\n1 a 15\n2 b ... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a Java program to check for a palindrome.
In addition to checking for palindromes, the program should also account for special characters, spaces, and letter case. For example, "A man, a plan, a canal: Panama" should be recognized as a palindrome.
Write a program that takes a string as input and determines whe... | [
{
"role": "user",
"content": "Create a Java program to check for a palindrome.\n\nIn addition to checking for palindromes, the program should also account for special characters, spaces, and letter case. For example, \"A man, a plan, a canal: Panama\" should be recognized as a palindrome.\n\nWrite a program... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.