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 new button using HTML and CSS and ensure that it changes color when hovered over. Additionally, implement functionality where the button's background color changes randomly every 3 seconds.
Now, modify the code to make the button's tooltip only appear when the button is clicked and disappear after 2 seconds.... | [
{
"role": "user",
"content": "Create a new button using HTML and CSS and ensure that it changes color when hovered over. Additionally, implement functionality where the button's background color changes randomly every 3 seconds. \n\nNow, modify the code to make the button's tooltip only appear when the butt... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a Python function to calculate the factorial of a number (a non-negative integer). However, you are not allowed to use the built-in `math.factorial()` function.
In addition, you should implement the function iteratively instead of recursively.
You should also optimize the function to have a time complexity of O... | [
{
"role": "user",
"content": "Write a Python function to calculate the factorial of a number (a non-negative integer). However, you are not allowed to use the built-in `math.factorial()` function.\n\nIn addition, you should implement the function iteratively instead of recursively.\n\nYou should also optimi... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a program that prints all prime numbers from 1 to 10,000, excluding the numbers 2 and 3 from the output. Additionally, the program should run in O(n*log(log(n))) time complexity. | [
{
"role": "user",
"content": "Create a program that prints all prime numbers from 1 to 10,000, excluding the numbers 2 and 3 from the output. Additionally, the program should run in O(n*log(log(n))) time complexity."
},
{
"role": "assistant",
"content": "To solve the problem of printing all prim... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Using the numpy library, create a 5x5 Identity Matrix with the following additional requirements and perform the following steps:
1. Import the numpy library.
2. Create a variable `n` and assign it a value of 5 to represent the size of the matrix.
3. Create a numpy array `identity_matrix` using the `np.eye()` function... | [
{
"role": "user",
"content": "Using the numpy library, create a 5x5 Identity Matrix with the following additional requirements and perform the following steps:\n\n1. Import the numpy library.\n2. Create a variable `n` and assign it a value of 5 to represent the size of the matrix.\n3. Create a numpy array `... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
How do you declare a variable in Python and assign it a value greater than 100, using only integers, without using any arithmetic operators or built-in functions, and the variable name should start with the letter "a"? | [
{
"role": "user",
"content": "How do you declare a variable in Python and assign it a value greater than 100, using only integers, without using any arithmetic operators or built-in functions, and the variable name should start with the letter \"a\"?"
},
{
"role": "assistant",
"content": "To dec... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Implement an algorithm to find the sum of all the prime numbers in an array, excluding any duplicate prime numbers.
The array is: [3, 5, 8, 10, 4, 13, 17, 8, 10, 13, 4]
Constraints:
1. You cannot use any built-in functions or libraries to calculate the sum or determine whether a number is prime.
2. The array can contai... | [
{
"role": "user",
"content": "Implement an algorithm to find the sum of all the prime numbers in an array, excluding any duplicate prime numbers.\nThe array is: [3, 5, 8, 10, 4, 13, 17, 8, 10, 13, 4]\nConstraints:\n1. You cannot use any built-in functions or libraries to calculate the sum or determine wheth... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a SQL query to select the top 5 highest salaries in a employees table, excluding any salaries that are equal to or lower than $100,000. Additionally, include the department name for each employee in the result set. However, the department name should be displayed in reverse alphabetical order. | [
{
"role": "user",
"content": "Write a SQL query to select the top 5 highest salaries in a employees table, excluding any salaries that are equal to or lower than $100,000. Additionally, include the department name for each employee in the result set. However, the department name should be displayed in rever... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Use try-except statements to detect and handle exceptions in the code.
for i in range(n):
try:
if i == 0:
raise ZeroDivisionError("Cannot divide by zero.")
x = 1/i
if x > 10:
raise ValueError("x cannot be greater than 10.")
elif x < -10:
raise Valu... | [
{
"role": "user",
"content": "Use try-except statements to detect and handle exceptions in the code.\nfor i in range(n):\n try:\n if i == 0:\n raise ZeroDivisionError(\"Cannot divide by zero.\")\n x = 1/i\n if x > 10:\n raise ValueError(\"x cannot be greater tha... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Find the total number of elements in a given multi-dimensional array. The array may contain integers, nested arrays, and even other data types such as strings or booleans. The elements can be located at any depth within the array structure. The array can have a maximum depth of 10 levels.
Time complexity: O(n), where ... | [
{
"role": "user",
"content": "Find the total number of elements in a given multi-dimensional array. The array may contain integers, nested arrays, and even other data types such as strings or booleans. The elements can be located at any depth within the array structure. The array can have a maximum depth of... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Given a string, write a function to remove all the duplicate characters and return the resulting string. The input string may contain any ASCII characters.
Write a function named "removeDuplicates" that takes a string "s" as input and returns a string.
The function should iterate through each character in the string ... | [
{
"role": "user",
"content": "Given a string, write a function to remove all the duplicate characters and return the resulting string. The input string may contain any ASCII characters.\n\nWrite a function named \"removeDuplicates\" that takes a string \"s\" as input and returns a string.\n\nThe function sh... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write code to flatten a nested list of integers and return the sum of all the elements. The nested list can contain integers and lists, and can have up to four levels of nesting. The final sum should only include the integers within the nested lists, and not the lists themselves.
Additionally, your code should be able... | [
{
"role": "user",
"content": "Write code to flatten a nested list of integers and return the sum of all the elements. The nested list can contain integers and lists, and can have up to four levels of nesting. The final sum should only include the integers within the nested lists, and not the lists themselve... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a Python program that allows the user to input multiple dates and times, and displays the corresponding day of the week, month, and year for each one. Implement error handling to ensure that the user enters valid dates and times. Display the full name of the day of the week (e.g. Monday, Tuesday) instead of just ... | [
{
"role": "user",
"content": "Write a Python program that allows the user to input multiple dates and times, and displays the corresponding day of the week, month, and year for each one. Implement error handling to ensure that the user enters valid dates and times. Display the full name of the day of the we... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a code to merge two given lists of equal size into a new list, such that the resulting list contains alternating elements from the two lists. However, the code should not use any additional memory to create the new list. Instead, it should modify the first list in-place to achieve the desired result.
Example:
li... | [
{
"role": "user",
"content": "Write a code to merge two given lists of equal size into a new list, such that the resulting list contains alternating elements from the two lists. However, the code should not use any additional memory to create the new list. Instead, it should modify the first list in-place t... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a Java program that prints out the sum of the numbers in the array.
int[] numbers = {1, 2, 3 , 4, 5};
Additional Instructions:
1. The program should use a recursive function to calculate the sum of the numbers in the array.
2. The recursive function should have a base case to stop the recursion.
3. The program... | [
{
"role": "user",
"content": "Create a Java program that prints out the sum of the numbers in the array.\n\nint[] numbers = {1, 2, 3 , 4, 5};\n\nAdditional Instructions:\n1. The program should use a recursive function to calculate the sum of the numbers in the array.\n2. The recursive function should have a... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a code to check whether the input string is a palindrome or not. However, you are not allowed to use any additional data structures (such as arrays or stacks) and you must solve the problem in-place with constant extra space. The solution should have a time complexity of O(n), where n is the length of the input s... | [
{
"role": "user",
"content": "Write a code to check whether the input string is a palindrome or not. However, you are not allowed to use any additional data structures (such as arrays or stacks) and you must solve the problem in-place with constant extra space. The solution should have a time complexity of ... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a JavaScript function that finds the shortest word in a string, excluding words that contain any uppercase letters or special characters. The function should return the shortest word that is longer than 3 characters, has at least one vowel, and has a consonant-vowel-consonant pattern. The string may contain punc... | [
{
"role": "user",
"content": "Create a JavaScript function that finds the shortest word in a string, excluding words that contain any uppercase letters or special characters. The function should return the shortest word that is longer than 3 characters, has at least one vowel, and has a consonant-vowel-cons... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Connect to a MySQL database and select all rows from Customers where Phone is greater than 1000, Country is "USA", and OrderDate is between January 1, 2022, and February 28, 2022. Additionally, sort the results in descending order based on the CustomerName and limit the output to only the first 10 rows. Implement the q... | [
{
"role": "user",
"content": "Connect to a MySQL database and select all rows from Customers where Phone is greater than 1000, Country is \"USA\", and OrderDate is between January 1, 2022, and February 28, 2022. Additionally, sort the results in descending order based on the CustomerName and limit the outpu... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a JavaScript program which takes an array of integers as a parameter and reverses the array in-place. The program should return the reversed array without using any built-in methods like `reverse()`. Additionally, the program should handle cases where the input array is empty or contains non-integer elements. Th... | [
{
"role": "user",
"content": "Create a JavaScript program which takes an array of integers as a parameter and reverses the array in-place. The program should return the reversed array without using any built-in methods like `reverse()`. Additionally, the program should handle cases where the input array is ... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a code to create a 5 x 5 matrix containing all 0s, but the matrix must be initialized using a recursive algorithm instead of a simple loop. Additionally, the recursive algorithm should use a depth-first search approach to populate the matrix, where each element is randomly assigned either 0 or 1.
#Erroneous Code... | [
{
"role": "user",
"content": "Write a code to create a 5 x 5 matrix containing all 0s, but the matrix must be initialized using a recursive algorithm instead of a simple loop. Additionally, the recursive algorithm should use a depth-first search approach to populate the matrix, where each element is randoml... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a code to return the first 5 prime numbers in a list of integers.
```python
import math
def is_prime(num):
if num < 2:
return False
for i in range(2, int(math.sqrt(num)) + 1):
if num % i == 0:
return False
return True
def get_first_five_primes(numbers):
primes = []
... | [
{
"role": "user",
"content": "Write a code to return the first 5 prime numbers in a list of integers.\n\n```python\nimport math\n\ndef is_prime(num):\n if num < 2:\n return False\n for i in range(2, int(math.sqrt(num)) + 1):\n if num % i == 0:\n return False\n return True\n... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a Java program to take a given string and replace all occurrences of a given letter with another given letter. Additionally, the program should only replace the given letter if it is at the beginning or the end of a word in the string. The program should also count and display the total number of replacements ma... | [
{
"role": "user",
"content": "Create a Java program to take a given string and replace all occurrences of a given letter with another given letter. Additionally, the program should only replace the given letter if it is at the beginning or the end of a word in the string. The program should also count and d... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a class in Java named Animal that has five instance variables: age, species, breed, name, and gender. The age variable should be an integer representing the age of the animal in months. The species variable should be a String representing the species of the animal. The breed variable should be a String represent... | [
{
"role": "user",
"content": "Create a class in Java named Animal that has five instance variables: age, species, breed, name, and gender. The age variable should be an integer representing the age of the animal in months. The species variable should be a String representing the species of the animal. The b... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a new array that contains only the even numbers from a given array. Additionally, the new array should be sorted in ascending order and all elements should be unique. If the given array is empty, return an empty array. Implement the solution in such a way that it has a time complexity of O(n) and does not use an... | [
{
"role": "user",
"content": "Create a new array that contains only the even numbers from a given array. Additionally, the new array should be sorted in ascending order and all elements should be unique. If the given array is empty, return an empty array. Implement the solution in such a way that it has a t... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Implement a function that finds the second maximum element in a given array. However, you are not allowed to use any built-in sorting functions or methods. Additionally, the time complexity of your solution should be less than O(n^2).
arr = [45, 7, 0, 82, 23]
#Difficulty Level: Difficult | [
{
"role": "user",
"content": "Implement a function that finds the second maximum element in a given array. However, you are not allowed to use any built-in sorting functions or methods. Additionally, the time complexity of your solution should be less than O(n^2).\n\narr = [45, 7, 0, 82, 23]\n\n#Difficulty ... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Connect to a MongoDB database, select all documents from the collection ‘customers’ where the 'age' field is greater than 30 and the 'gender' field is 'female'. Then, for each selected document, retrieve the corresponding document from another collection called 'orders' based on the 'customer_id' field. Finally, displa... | [
{
"role": "user",
"content": "Connect to a MongoDB database, select all documents from the collection ‘customers’ where the 'age' field is greater than 30 and the 'gender' field is 'female'. Then, for each selected document, retrieve the corresponding document from another collection called 'orders' based o... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a Java program to print out the first n prime numbers, where n must be a positive integer greater than 1 and less than or equal to 1000. The program should also ensure that the user provides a valid input by repeatedly asking for a valid value of n until it is provided. Additionally, the program should calculate ... | [
{
"role": "user",
"content": "Write a Java program to print out the first n prime numbers, where n must be a positive integer greater than 1 and less than or equal to 1000. The program should also ensure that the user provides a valid input by repeatedly asking for a valid value of n until it is provided. A... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Implement a function to extract the last three words from a string of words, where the string contains at least five words and each word is separated by a single space. The function should ignore any leading or trailing spaces in the input string and handle punctuation marks (such as commas, periods, and exclamation ma... | [
{
"role": "user",
"content": "Implement a function to extract the last three words from a string of words, where the string contains at least five words and each word is separated by a single space. The function should ignore any leading or trailing spaces in the input string and handle punctuation marks (s... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Find the index of a given item in an array, but the array may contain duplicate items. If the item appears multiple times in the array, return the index of the last occurrence. You need to implement the solution without using any built-in functions or libraries that directly solve the problem, such as the "index" metho... | [
{
"role": "user",
"content": "Find the index of a given item in an array, but the array may contain duplicate items. If the item appears multiple times in the array, return the index of the last occurrence. You need to implement the solution without using any built-in functions or libraries that directly so... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a program in Java to generate the Fibonacci sequence up to N numbers, where N is a positive integer greater than 1. However, you are not allowed to use recursion or any built-in functions or libraries to calculate the Fibonacci numbers. You must implement your own algorithm to generate the sequence.
Additionally... | [
{
"role": "user",
"content": "Write a program in Java to generate the Fibonacci sequence up to N numbers, where N is a positive integer greater than 1. However, you are not allowed to use recursion or any built-in functions or libraries to calculate the Fibonacci numbers. You must implement your own algorit... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a code to reverse the order of a data structure such as array, list, or stack without using any built-in functions or methods that directly reverse the data structure. The code should modify the data structure in-place and have a time complexity of O(n), where n is the size of the data structure.
list1 = [1, 3, ... | [
{
"role": "user",
"content": "Write a code to reverse the order of a data structure such as array, list, or stack without using any built-in functions or methods that directly reverse the data structure. The code should modify the data structure in-place and have a time complexity of O(n), where n is the si... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a table to store customer information, ensuring that each customer's email address is unique, case-insensitive unique, and that the phone number is in the format xxx-xxx-xxxx. Additionally, implement password encryption using a suitable encryption algorithm such as bcrypt or Argon2 for the customer's information... | [
{
"role": "user",
"content": "Create a table to store customer information, ensuring that each customer's email address is unique, case-insensitive unique, and that the phone number is in the format xxx-xxx-xxxx. Additionally, implement password encryption using a suitable encryption algorithm such as bcryp... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Increase the difficulty by requiring the function to calculate the sum of only even numbers in the input list and include error handling for invalid input.
Redesign the following Python program with functions.
Create a function called "calculate_sum" that takes in a list of numbers as a parameter.
Inside the function,... | [
{
"role": "user",
"content": "Increase the difficulty by requiring the function to calculate the sum of only even numbers in the input list and include error handling for invalid input.\n\nRedesign the following Python program with functions.\nCreate a function called \"calculate_sum\" that takes in a list ... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Construct a SQL query to find all columns in a table called "customers" where the first name is equal to 'John', the last name is equal to 'Doe', the age is greater than 30, and the email is not empty. | [
{
"role": "user",
"content": "Construct a SQL query to find all columns in a table called \"customers\" where the first name is equal to 'John', the last name is equal to 'Doe', the age is greater than 30, and the email is not empty."
},
{
"role": "assistant",
"content": "Here is a SQL query tha... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a class in Python to represent a Person. The Person class should have the following attributes and methods:
Attributes:
1. Name: A string representing the person's name.
2. Age: An integer representing the person's age.
3. Height: A float representing the person's height in meters.
4. Weight: A float representi... | [
{
"role": "user",
"content": "Create a class in Python to represent a Person. The Person class should have the following attributes and methods:\n\nAttributes:\n1. Name: A string representing the person's name.\n2. Age: An integer representing the person's age.\n3. Height: A float representing the person's ... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a program that extracts a given pattern from a given string. The pattern can be a single character or a substring. If the pattern is a single character, it should only match when it is surrounded by spaces or punctuation marks. However, if the pattern is a substring, it should only match when it is surrounded by... | [
{
"role": "user",
"content": "Create a program that extracts a given pattern from a given string. The pattern can be a single character or a substring. If the pattern is a single character, it should only match when it is surrounded by spaces or punctuation marks. However, if the pattern is a substring, it ... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Please write a function to calculate the weighted average score of a list of numbers, where each number is multiplied by a corresponding weight. The weights are provided in a separate list of the same length.
However, there is a bug in the code provided below. Your task is to identify and fix the bug.
```python
def c... | [
{
"role": "user",
"content": "Please write a function to calculate the weighted average score of a list of numbers, where each number is multiplied by a corresponding weight. The weights are provided in a separate list of the same length.\n\nHowever, there is a bug in the code provided below. Your task is t... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Debug the following JavaScript code which calculates the median of an array of integers. The median is the middle value of a sorted array. If the array has an odd length, the median is the value at the center position. If the array has an even length, the median is the average of the two middle values.
The input array... | [
{
"role": "user",
"content": "Debug the following JavaScript code which calculates the median of an array of integers. The median is the middle value of a sorted array. If the array has an odd length, the median is the value at the center position. If the array has an even length, the median is the average ... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a function that determines if a given number is a prime number, while ensuring the time complexity is less than or equal to O(sqrt(n)). Additionally, the function should also output the prime factors of the number if it is not a prime number.
The input number will be a positive integer greater than 1.
Example:
... | [
{
"role": "user",
"content": "Write a function that determines if a given number is a prime number, while ensuring the time complexity is less than or equal to O(sqrt(n)). Additionally, the function should also output the prime factors of the number if it is not a prime number.\n\nThe input number will be a... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a program that implements a more complex logic for the given switch statement.
Extend the switch statement to include additional cases, such as case 3, case 4, and so on. Each case should call a different function, such as func3(), func4(), and so on.
Additionally, modify the program to include a default case... | [
{
"role": "user",
"content": "Create a program that implements a more complex logic for the given switch statement. \n\nExtend the switch statement to include additional cases, such as case 3, case 4, and so on. Each case should call a different function, such as func3(), func4(), and so on.\n\nAdditionally... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Use the function to debug the given program and prevent the segmentation fault. Your solution should also handle the case where the array contains duplicate elements. You are not allowed to use any additional data structures. Additionally, the time complexity of your solution should be O(n) and the space complexity sho... | [
{
"role": "user",
"content": "Use the function to debug the given program and prevent the segmentation fault. Your solution should also handle the case where the array contains duplicate elements. You are not allowed to use any additional data structures. Additionally, the time complexity of your solution s... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Read a code and identify the data type of the variables a, b, and c.
a = [1, 2, 3, 4]
b = "Hello"
c = a + b
Step 1: Read the code and identify the variables a, b, and c.
Step 2: Determine the data type of variable a.
Step 3: Determine the data type of variable b.
Step 4: Determine the data type of variable c.
Step 5: ... | [
{
"role": "user",
"content": "Read a code and identify the data type of the variables a, b, and c.\na = [1, 2, 3, 4]\nb = \"Hello\"\nc = a + b\n\nStep 1: Read the code and identify the variables a, b, and c.\nStep 2: Determine the data type of variable a.\nStep 3: Determine the data type of variable b.\nSte... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a webpage that consists of an HTML form with the following components: a textbox, a submit button, and two radio buttons.
1. The textbox should have the following validation rules:
- Only allow alphanumeric characters
- Do not allow the textbox to be empty when the submit button is clicked
- Restrict ... | [
{
"role": "user",
"content": "Create a webpage that consists of an HTML form with the following components: a textbox, a submit button, and two radio buttons. \n\n1. The textbox should have the following validation rules:\n - Only allow alphanumeric characters\n - Do not allow the textbox to be empty wh... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a Java program to calculate the product of two given integers. The program should take two integers as input from the user and display the product.
Additional Requirements:
1. Validate the input to ensure that the user enters valid integers. If the input is not a valid integer, display an error message and ask t... | [
{
"role": "user",
"content": "Write a Java program to calculate the product of two given integers. The program should take two integers as input from the user and display the product.\n\nAdditional Requirements:\n1. Validate the input to ensure that the user enters valid integers. If the input is not a vali... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Generate a unique and random password for a user using Python. The password must meet the following criteria:
1. The password must be at least 16 characters long.
2. The password must contain at least two uppercase letters, two lowercase letters, two numbers, and two special characters.
3. The password must not contain... | [
{
"role": "user",
"content": "Generate a unique and random password for a user using Python. The password must meet the following criteria:\n1. The password must be at least 16 characters long.\n2. The password must contain at least two uppercase letters, two lowercase letters, two numbers, and two special ... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a query in MongoDB to find all the documents in the collection "Books" where the "author" field starts with "John" and ends with "Smith" and the "title" field contains the word "Adventure". | [
{
"role": "user",
"content": "Write a query in MongoDB to find all the documents in the collection \"Books\" where the \"author\" field starts with \"John\" and ends with \"Smith\" and the \"title\" field contains the word \"Adventure\"."
},
{
"role": "assistant",
"content": "Here's a MongoDB qu... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a JavaScript function to check if an array contains a specific element and return the index of that element. If the element is not found, return -1. The array can contain both numbers and strings. The function should have a time complexity of O(n), where n is the number of elements in the array.
var arr = [1,2,3... | [
{
"role": "user",
"content": "Write a JavaScript function to check if an array contains a specific element and return the index of that element. If the element is not found, return -1. The array can contain both numbers and strings. The function should have a time complexity of O(n), where n is the number o... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a function to determine if two strings are anagrams of each other. The function should have a time complexity of O(n log n), where n is the length of the strings. The function should also use constant space, meaning it should not use additional data structures besides a few variables for counting purposes. Additi... | [
{
"role": "user",
"content": "Write a function to determine if two strings are anagrams of each other. The function should have a time complexity of O(n log n), where n is the length of the strings. The function should also use constant space, meaning it should not use additional data structures besides a f... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Debug the following Python code:
```python
def f(x):
if x > 0:
return -1
elif x < 0:
return 1
elif x == 0:
return 2
else:
return 0
```
Write test cases to validate the correctness of the code. The test cases should cover all possible edge cases and inputs, including lar... | [
{
"role": "user",
"content": "Debug the following Python code:\n\n```python\ndef f(x):\n if x > 0:\n return -1\n elif x < 0:\n return 1\n elif x == 0:\n return 2\n else:\n return 0\n```\n\nWrite test cases to validate the correctness of the code. The test cases should... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Given a binary tree, write a code snippet to list all of its descendant nodes that are at an even level and whose values are divisible by a prime number. Additionally, the code should return the sum of all the values of the descendant nodes that meet the given conditions. The time complexity of the code should not exce... | [
{
"role": "user",
"content": "Given a binary tree, write a code snippet to list all of its descendant nodes that are at an even level and whose values are divisible by a prime number. Additionally, the code should return the sum of all the values of the descendant nodes that meet the given conditions. The t... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a function that takes a string and returns a boolean based on whether the string is a palindrome or not. The function should ignore any non-alphabetic characters, should be case-sensitive, and should also consider numbers and special characters as part of the palindrome check. Additionally, the function should ha... | [
{
"role": "user",
"content": "Write a function that takes a string and returns a boolean based on whether the string is a palindrome or not. The function should ignore any non-alphabetic characters, should be case-sensitive, and should also consider numbers and special characters as part of the palindrome c... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a program that calculates the height of a triangle given the angle, side lengths, opposite side length, and the ratio of the side lengths. The program should take into account the Law of Sines and the Law of Cosines. Additionally, the program should simulate the effect of air resistance on the trajectory of the t... | [
{
"role": "user",
"content": "Write a program that calculates the height of a triangle given the angle, side lengths, opposite side length, and the ratio of the side lengths. The program should take into account the Law of Sines and the Law of Cosines. Additionally, the program should simulate the effect of... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
## Problem ##
You are given a string, and you need to write a function that performs the following operations on the string:
1. Remove all duplicate characters.
2. Sort the remaining characters in ascending order based on their ASCII values.
3. Count the number of vowels and consonants in the modified string and retur... | [
{
"role": "user",
"content": "## Problem ##\n\nYou are given a string, and you need to write a function that performs the following operations on the string:\n1. Remove all duplicate characters.\n2. Sort the remaining characters in ascending order based on their ASCII values.\n3. Count the number of vowels ... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a query in SQL to select all the rows from table Books and display only the books that were published in the last 5 years and have an average rating of at least 4.5. Additionally, sort the books in descending order based on the number of reviews they have received. | [
{
"role": "user",
"content": "Write a query in SQL to select all the rows from table Books and display only the books that were published in the last 5 years and have an average rating of at least 4.5. Additionally, sort the books in descending order based on the number of reviews they have received."
},
... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a Ruby program to search for a specific item in an array of strings and return the number of occurrences of that item in the array. If the item is not found, return -1.
Example:
array = ["Apple", "Banana", "Mango", "Orange", "Banana", "Apple"]
search_item = "Banana"
Expected output:
2
Write a Ruby program to s... | [
{
"role": "user",
"content": "Write a Ruby program to search for a specific item in an array of strings and return the number of occurrences of that item in the array. If the item is not found, return -1.\n\nExample:\narray = [\"Apple\", \"Banana\", \"Mango\", \"Orange\", \"Banana\", \"Apple\"]\nsearch_item... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Find the smallest element in a given array of positive integers, where the array length is between 1 and 100, the values are between 1 and 1000, and the array is not sorted. Implement the solution using a divide and conquer approach, and ensure that the algorithm has a time complexity of O(log n). [6, 8, 1, 4, 5] | [
{
"role": "user",
"content": "Find the smallest element in a given array of positive integers, where the array length is between 1 and 100, the values are between 1 and 1000, and the array is not sorted. Implement the solution using a divide and conquer approach, and ensure that the algorithm has a time com... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a Swift code that calculates the Fibonacci sequence up to a given number N. The user should input the value of N.
1. Create a variable named "n" and assign it to a user input, prompting them to enter a number N.
2. Implement a function named "fibonacci" that takes in a parameter "n" and returns an array contai... | [
{
"role": "user",
"content": "Create a Swift code that calculates the Fibonacci sequence up to a given number N. The user should input the value of N.\n\n1. Create a variable named \"n\" and assign it to a user input, prompting them to enter a number N.\n\n2. Implement a function named \"fibonacci\" that ta... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a list of three-word phrases using each of the six words ('apple', 'bear', 'cat', 'dog', 'elephant', 'fish'). The first word in each phrase should be a noun, the second word should be a verb, and the third word should be an adjective. Additionally, each phrase should contain at least one word that starts with a ... | [
{
"role": "user",
"content": "Create a list of three-word phrases using each of the six words ('apple', 'bear', 'cat', 'dog', 'elephant', 'fish'). The first word in each phrase should be a noun, the second word should be a verb, and the third word should be an adjective. Additionally, each phrase should con... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Design a data structure that efficiently stores an array of words, where each word is stored in a Trie data structure. The data structure should support the following operations:
1. `insert(word)`: Inserts a new word into the data structure. The time complexity of this operation should be O(N), where N is the length o... | [
{
"role": "user",
"content": "Design a data structure that efficiently stores an array of words, where each word is stored in a Trie data structure. The data structure should support the following operations:\n\n1. `insert(word)`: Inserts a new word into the data structure. The time complexity of this opera... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a JavaScript code to validate a password based on the following rules:
1. The password must be at least 16 characters long.
2. The password must contain at least two uppercase letters and two lowercase letters.
3. The password must contain at least two special characters (!@#$%^&*).
4. The password must not cont... | [
{
"role": "user",
"content": "Write a JavaScript code to validate a password based on the following rules:\n\n1. The password must be at least 16 characters long.\n2. The password must contain at least two uppercase letters and two lowercase letters.\n3. The password must contain at least two special charac... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Explain what the following piece of code does and identify any errors, if present.
```python
def calculate_modulo(x, y):
"""
This function takes two numbers, x and y, as input and calculates the modulo of x divided by y.
The function returns the result of the modulo calculation.
"""
if not isinsta... | [
{
"role": "user",
"content": "Explain what the following piece of code does and identify any errors, if present.\n\n```python\ndef calculate_modulo(x, y):\n \"\"\"\n This function takes two numbers, x and y, as input and calculates the modulo of x divided by y.\n The function returns the result of ... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a function to calculate the arithmetic mean of an array of numbers, but the array may contain negative numbers as well.
The arithmetic mean is calculated by summing up all the numbers in the array and then dividing it by the total count of numbers in the array.
However, there is an error in the given code. The ... | [
{
"role": "user",
"content": "Write a function to calculate the arithmetic mean of an array of numbers, but the array may contain negative numbers as well.\n\nThe arithmetic mean is calculated by summing up all the numbers in the array and then dividing it by the total count of numbers in the array.\n\nHowe... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a function to remove all occurrences of a given element from a list while maintaining the original order of the remaining elements. The function should have a time complexity of O(n) and should not use any built-in functions or libraries to remove the elements.
Additionally, you are not allowed to create a new l... | [
{
"role": "user",
"content": "Write a function to remove all occurrences of a given element from a list while maintaining the original order of the remaining elements. The function should have a time complexity of O(n) and should not use any built-in functions or libraries to remove the elements.\n\nAdditio... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Find the longest common substring between two strings, case-insensitive.
s1 = "TangibleDevelopment"
s2 = "IntangibleDevelopment"
You are required to implement a function called "longest_common_substring" that takes two strings as input and returns the longest common substring found between them. The function should ... | [
{
"role": "user",
"content": "Find the longest common substring between two strings, case-insensitive. \n\ns1 = \"TangibleDevelopment\"\ns2 = \"IntangibleDevelopment\"\n\nYou are required to implement a function called \"longest_common_substring\" that takes two strings as input and returns the longest comm... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a function in Python that calculates the nth term of the Fibonacci sequence efficiently using memoization. The function should be able to handle large numbers. Additionally, provide a summary in <100 words about Ada Lovelace's contributions to computer programming, her relationship with Charles Babbage, and the y... | [
{
"role": "user",
"content": "Write a function in Python that calculates the nth term of the Fibonacci sequence efficiently using memoization. The function should be able to handle large numbers. Additionally, provide a summary in <100 words about Ada Lovelace's contributions to computer programming, her re... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write an SQL statement to select the name, city and country of all stores, but exclude any stores located in countries starting with the letter "A" and ending with the letter "Y", and where the store has more than 100 employees. | [
{
"role": "user",
"content": "Write an SQL statement to select the name, city and country of all stores, but exclude any stores located in countries starting with the letter \"A\" and ending with the letter \"Y\", and where the store has more than 100 employees."
},
{
"role": "assistant",
"conte... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write code to find the smallest number in an array of numbers, without using any built-in functions or methods.
Additional requirements:
1. The solution should have a time complexity of O(n), where n is the number of elements in the array.
2. The solution should handle negative numbers in the array.
3. The solution sh... | [
{
"role": "user",
"content": "Write code to find the smallest number in an array of numbers, without using any built-in functions or methods.\n\nAdditional requirements:\n1. The solution should have a time complexity of O(n), where n is the number of elements in the array.\n2. The solution should handle neg... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a program to generate all possible pairs of a given list of numbers where the sum of each pair is a prime number. Additionally, ensure that each pair consists of two unique numbers from the given list and the pairs are sorted in ascending order. The program should also check if the sum of each pair is a perfect ... | [
{
"role": "user",
"content": "Create a program to generate all possible pairs of a given list of numbers where the sum of each pair is a prime number. Additionally, ensure that each pair consists of two unique numbers from the given list and the pairs are sorted in ascending order. The program should also c... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Sort the given list of numbers in descending order and return the sum of the first and second elements of the sorted list as the largest number.
List: [11, 9, 7, 5] | [
{
"role": "user",
"content": "Sort the given list of numbers in descending order and return the sum of the first and second elements of the sorted list as the largest number.\n\nList: [11, 9, 7, 5]"
},
{
"role": "assistant",
"content": "You want to:\n\n1. Sort the list **in descending order**.\n... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Generate a random string of length N, where N is a positive integer input by the user, using Python. The string should consist of lowercase letters, uppercase letters, digits, and special characters. Additionally, the string should not contain any repeated characters.
**Erroneous Code:**
```
import random
def generat... | [
{
"role": "user",
"content": "Generate a random string of length N, where N is a positive integer input by the user, using Python. The string should consist of lowercase letters, uppercase letters, digits, and special characters. Additionally, the string should not contain any repeated characters.\n\n**Erro... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a code to compare two lists and find the common elements, taking into consideration that both lists can contain duplicate elements and the output should only include the common elements once. Additionally, the code should have a time complexity of O(n+m), where n and m are the lengths of the two lists.
list1 = ... | [
{
"role": "user",
"content": "Write a code to compare two lists and find the common elements, taking into consideration that both lists can contain duplicate elements and the output should only include the common elements once. Additionally, the code should have a time complexity of O(n+m), where n and m ar... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write efficient C++ code to find the maximum subarray sum of a given array, taking into consideration that the array can contain both positive and negative integers. The code should also keep track of the starting and ending indices of the subarray that results in the maximum sum. Additionally, the code should handle t... | [
{
"role": "user",
"content": "Write efficient C++ code to find the maximum subarray sum of a given array, taking into consideration that the array can contain both positive and negative integers. The code should also keep track of the starting and ending indices of the subarray that results in the maximum s... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Please write a function in Java that takes two strings as parameters and returns true if the first string is a substring of the second. Additionally, the function should also return true if the first string is a subsequence of the second string.
A subsequence is defined as a sequence that can be derived from another s... | [
{
"role": "user",
"content": "Please write a function in Java that takes two strings as parameters and returns true if the first string is a substring of the second. Additionally, the function should also return true if the first string is a subsequence of the second string.\n\nA subsequence is defined as a... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a Python program that prints the Fibonacci sequence up to the Nth term, where N is a user-inputted positive integer.
The Fibonacci sequence is a series of numbers where each number is the sum of the two preceding ones. The sequence starts with 0 and 1.
To solve this problem, follow these steps:
1. Prompt the u... | [
{
"role": "user",
"content": "Write a Python program that prints the Fibonacci sequence up to the Nth term, where N is a user-inputted positive integer.\n\nThe Fibonacci sequence is a series of numbers where each number is the sum of the two preceding ones. The sequence starts with 0 and 1.\n\nTo solve this... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Count the number of unique words in a given text using Python. The text may contain multiple sentences and may include punctuation marks and special characters. You should consider all words as case-insensitive and remove any leading or trailing spaces before counting the unique words. Your solution should have a time ... | [
{
"role": "user",
"content": "Count the number of unique words in a given text using Python. The text may contain multiple sentences and may include punctuation marks and special characters. You should consider all words as case-insensitive and remove any leading or trailing spaces before counting the uniqu... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Estimate the time complexity of the following algorithm, considering that n must be greater than or equal to 100 and less than or equal to 1000. Additionally, the algorithm should be modified to only print the sum if it is a prime number. The algorithm should also ensure that the sum is computed using a recursive funct... | [
{
"role": "user",
"content": "Estimate the time complexity of the following algorithm, considering that n must be greater than or equal to 100 and less than or equal to 1000. Additionally, the algorithm should be modified to only print the sum if it is a prime number. The algorithm should also ensure that t... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
For the following two arrays, create a code snippet to return all intersecting elements. The solution must have a time complexity of O(n), where n is the length of the arrays, and must not use any built-in intersection functions or data structures. Additionally, the code snippet should be implemented using only constan... | [
{
"role": "user",
"content": "For the following two arrays, create a code snippet to return all intersecting elements. The solution must have a time complexity of O(n), where n is the length of the arrays, and must not use any built-in intersection functions or data structures. Additionally, the code snippe... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a Python function to check if a value exists in a list of integers, and return the number of occurrences of that value in the list. However, you are not allowed to use any built-in Python functions or libraries such as "in", "count", or "collections". You must implement your own logic to achieve the desired resul... | [
{
"role": "user",
"content": "Write a Python function to check if a value exists in a list of integers, and return the number of occurrences of that value in the list. However, you are not allowed to use any built-in Python functions or libraries such as \"in\", \"count\", or \"collections\". You must imple... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a function that takes in a list of integers and returns the average of all the prime numbers in the list. The function should ignore any non-integer values in the list. If there are no prime numbers in the list, the function should return -1. | [
{
"role": "user",
"content": "Create a function that takes in a list of integers and returns the average of all the prime numbers in the list. The function should ignore any non-integer values in the list. If there are no prime numbers in the list, the function should return -1."
},
{
"role": "assis... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a Python program to remove all instances of a given value from a given list, but without using any built-in Python methods or libraries. The program should only use basic programming constructs and logic to achieve the desired result.
Additional requirements:
1. The program should handle cases where the given li... | [
{
"role": "user",
"content": "Write a Python program to remove all instances of a given value from a given list, but without using any built-in Python methods or libraries. The program should only use basic programming constructs and logic to achieve the desired result.\n\nAdditional requirements:\n1. The p... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Please classify the following transaction as valid or invalid using Python.
Transaction ID: 101
Transaction Amount: -200
Provide a piece of erroneous code as a reference to increase misdirection:
```python
def validate_transaction(transaction_id, transaction_amount):
if transaction_id > 0 and transaction_amount ... | [
{
"role": "user",
"content": "Please classify the following transaction as valid or invalid using Python.\n\nTransaction ID: 101\nTransaction Amount: -200\n\nProvide a piece of erroneous code as a reference to increase misdirection:\n\n```python\ndef validate_transaction(transaction_id, transaction_amount):... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Reverse a string using Python code and without using any built-in string reversal functions, slicing, or any additional data structures. Additionally, ensure that the solution has a time complexity of O(n) and a space complexity of O(1), where n is the length of the string. | [
{
"role": "user",
"content": "Reverse a string using Python code and without using any built-in string reversal functions, slicing, or any additional data structures. Additionally, ensure that the solution has a time complexity of O(n) and a space complexity of O(1), where n is the length of the string."
... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a JavaScript function that takes an array of positive integers and returns the kth smallest prime number from the array, where k is an input parameter to the function. However, the function should only iterate through the array once and should not use any built-in JavaScript functions to check for prime numbers. | [
{
"role": "user",
"content": "Create a JavaScript function that takes an array of positive integers and returns the kth smallest prime number from the array, where k is an input parameter to the function. However, the function should only iterate through the array once and should not use any built-in JavaSc... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a function in Java that compares two strings character-by-character and returns the number of differences between them. However, you are not allowed to use any built-in Java methods or libraries for string comparison. Additionally, ensure that your solution has a time complexity of O(n) and a space complexity of ... | [
{
"role": "user",
"content": "Write a function in Java that compares two strings character-by-character and returns the number of differences between them. However, you are not allowed to use any built-in Java methods or libraries for string comparison. Additionally, ensure that your solution has a time com... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a Python function to check if a given string is a palindrome or not. A palindrome is a word, phrase, number, or other sequence of characters that reads the same forward and backward.
word = "racecar" | [
{
"role": "user",
"content": "Write a Python function to check if a given string is a palindrome or not. A palindrome is a word, phrase, number, or other sequence of characters that reads the same forward and backward.\n\nword = \"racecar\""
},
{
"role": "assistant",
"content": "Sure! Here's a P... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Design a function in Python that returns the k-th smallest element in an array of integers. The array may contain duplicates and the function should handle both positive and negative integers. The function should have a time complexity of O(nlogn) and space complexity of O(1). Additionally, the function should not use ... | [
{
"role": "user",
"content": "Design a function in Python that returns the k-th smallest element in an array of integers. The array may contain duplicates and the function should handle both positive and negative integers. The function should have a time complexity of O(nlogn) and space complexity of O(1). ... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Generate an array with the first 50 prime numbers, where each prime number must be greater than 100. | [
{
"role": "user",
"content": "Generate an array with the first 50 prime numbers, where each prime number must be greater than 100."
},
{
"role": "assistant",
"content": "To generate an array containing the **first 50 prime numbers greater than 100**, we can use a prime-checking function and iter... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a Javascript code to check if the given number is a prime number. Additionally, the code should also check if the number is a perfect square and a palindrome. The code should have a time complexity of O(sqrt(n)) for prime number checking and a space complexity of O(1). | [
{
"role": "user",
"content": "Write a Javascript code to check if the given number is a prime number. Additionally, the code should also check if the number is a perfect square and a palindrome. The code should have a time complexity of O(sqrt(n)) for prime number checking and a space complexity of O(1)."
... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Design an algorithm that creates a random password of 20 characters with the following requirements:
1. The password must contain at least three uppercase letters, three lowercase letters, three digits, and three special characters.
2. The password must not contain any repeated characters or consecutive characters from... | [
{
"role": "user",
"content": "Design an algorithm that creates a random password of 20 characters with the following requirements:\n1. The password must contain at least three uppercase letters, three lowercase letters, three digits, and three special characters.\n2. The password must not contain any repeat... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a program that prints the first 20 Fibonacci numbers, but with a twist. Implement the Fibonacci sequence using a recursive function. However, the program should also handle negative input values and print an error message if the input is negative. Additionally, the program should have a time complexity of O(n) a... | [
{
"role": "user",
"content": "Create a program that prints the first 20 Fibonacci numbers, but with a twist. Implement the Fibonacci sequence using a recursive function. However, the program should also handle negative input values and print an error message if the input is negative. Additionally, the progr... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a program to display all prime numbers between a given range, with the additional requirement that the program should also check for palindromic primes. However, the program should exclude all prime numbers that are also perfect cubes.
a, b = 2, 100
**Erroneous Code Reference:**
```
def is_palindrome(n):
r... | [
{
"role": "user",
"content": "Create a program to display all prime numbers between a given range, with the additional requirement that the program should also check for palindromic primes. However, the program should exclude all prime numbers that are also perfect cubes.\n\na, b = 2, 100\n\n**Erroneous Cod... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Update the existing HTML structure to add a new div class named "container" inside the body element. The container div should have a minimum width of 800 pixels and a maximum width of 1200 pixels. It should also be centered horizontally on the page. In addition to these requirements, the container div should have a fix... | [
{
"role": "user",
"content": "Update the existing HTML structure to add a new div class named \"container\" inside the body element. The container div should have a minimum width of 800 pixels and a maximum width of 1200 pixels. It should also be centered horizontally on the page. In addition to these requi... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write a program that prompts the user to enter their age and then determines and displays their age group based on the following criteria:
- If the age is less than 13, display "Child".
- If the age is between 13 and 19 (both inclusive), display "Teenager".
- If the age is between 20 and 64 (both inclusive), display "A... | [
{
"role": "user",
"content": "Write a program that prompts the user to enter their age and then determines and displays their age group based on the following criteria:\n- If the age is less than 13, display \"Child\".\n- If the age is between 13 and 19 (both inclusive), display \"Teenager\".\n- If the age ... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Generate a 15-digit random number using Python. The number must be prime, contain at least one repeated digit, and the sum of its digits must be a multiple of 3. | [
{
"role": "user",
"content": "Generate a 15-digit random number using Python. The number must be prime, contain at least one repeated digit, and the sum of its digits must be a multiple of 3."
},
{
"role": "assistant",
"content": "To generate a **15-digit random prime number** that:\n\n- Is **pr... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Write code to find the longest substring of unique characters in a given string, without using any built-in string functions or data structures. The solution should have a time complexity of O(n).
string = 'abcabcbb'
In addition to finding the longest substring, please also print the starting and ending indices of th... | [
{
"role": "user",
"content": "Write code to find the longest substring of unique characters in a given string, without using any built-in string functions or data structures. The solution should have a time complexity of O(n).\n\nstring = 'abcabcbb'\n\nIn addition to finding the longest substring, please al... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a Node.js function to concatenate two strings. The function should not use the built-in string concatenation operator (+) or the string template literal feature. Additionally, the function should only return the concatenated string if the combined length of the two input strings is less than or equal to 100 char... | [
{
"role": "user",
"content": "Create a Node.js function to concatenate two strings. The function should not use the built-in string concatenation operator (+) or the string template literal feature. Additionally, the function should only return the concatenated string if the combined length of the two input... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a CSS rule that sets the font-weight of all h1 headings to bold and also adds a requirement that the font-size of the h1 headings should be 24 pixels. Additionally, the font-family of the h1 headings should be 'Arial' and the color should be 'red'. Finally, ensure that the h1 headings have a margin of 10 pixels ... | [
{
"role": "user",
"content": "Create a CSS rule that sets the font-weight of all h1 headings to bold and also adds a requirement that the font-size of the h1 headings should be 24 pixels. Additionally, the font-family of the h1 headings should be 'Arial' and the color should be 'red'. Finally, ensure that t... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Create a function called 'generate_message' that takes in three parameters: 'name' (a string), 'age' (an integer), and 'gender' (a string). The function should return a message in the following format: "Hello, [name]! You are a [gender] who is [age] years old."
Note: The function should validate the 'gender' parameter... | [
{
"role": "user",
"content": "Create a function called 'generate_message' that takes in three parameters: 'name' (a string), 'age' (an integer), and 'gender' (a string). The function should return a message in the following format: \"Hello, [name]! You are a [gender] who is [age] years old.\"\n\nNote: The f... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Generate a list of the first ten even numbers in reverse order, where each number must be divisible by 4, greater than 100, and not end with the digit 8. | [
{
"role": "user",
"content": "Generate a list of the first ten even numbers in reverse order, where each number must be divisible by 4, greater than 100, and not end with the digit 8."
},
{
"role": "assistant",
"content": "We are asked to generate a **list of the first ten even numbers** that me... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Given a string, write a Python program to find the first non-repeating character in it, without using any built-in Python functions or libraries. Additionally, the program should also handle cases where the input string contains special characters or numbers.
The program should have the following additional requiremen... | [
{
"role": "user",
"content": "Given a string, write a Python program to find the first non-repeating character in it, without using any built-in Python functions or libraries. Additionally, the program should also handle cases where the input string contains special characters or numbers.\n\nThe program sho... | Qwen/Qwen3-4B | off | Qwen/Qwen3-4B | true |
Convert the given binary string to its corresponding decimal number. However, you are not allowed to use any built-in functions or libraries for converting binary to decimal. You must implement your own algorithm to solve the problem.
Additionally, your algorithm must have a time complexity of O(n), where n is the len... | [
{
"role": "user",
"content": "Convert the given binary string to its corresponding decimal number. However, you are not allowed to use any built-in functions or libraries for converting binary to decimal. You must implement your own algorithm to solve the problem.\n\nAdditionally, your algorithm must have a... | 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.