instruction_seed stringlengths 0 26.4k | source stringclasses 4
values |
|---|---|
Remove all duplicates from this list using Python
list=[5,5,5,7,8,8,9] | codefeedback |
Edit the code to produce the output of the following matrix multiplication
X = [[2, 3, 9],
[8, 7, 6],
[1, 6, 4]]
Y = [[9, 4, 5],
[7, 3, 3],
[2, 1, 5]] | codefeedback |
Write a Python program to generate a 3x3 Identity matrix | codefeedback |
Write a function to reverse an integer.
x = 12345 | codefeedback |
Write a Java code to find the longest common prefix in a string array.
String [] arr = {"flower","flow","flight"} | codefeedback |
Create a function to evaluate a given expression written in infix notation.
exp = "5 + (7 * 8) / 3" | codefeedback |
Create an algorithm in C# with a time complexity of O(n2). | codefeedback |
Describe how LSTMs are used to predict time-series data. | codefeedback |
Write a regex to detect valid email addresses. | codefeedback |
Convert a given list to a dictionary with items as keys and their corresponding position in the list as values.
[‘a’, ‘b’, ‘c’, ‘d’] | codefeedback |
Create a class that has 3 methods. The first method should multiply two numbers, the second should add two numbers, and the third should calculate the modulus of two numbers. | codefeedback |
Write a regular expression to find all the email addresses in a given text. | codefeedback |
Suggest a way to extract all the words from an HTML page using Python. | codefeedback |
Write a schema for a table to store student grades in a school. | codefeedback |
Create a data visualization comparing the population of California and New York. | codefeedback |
Develop a Chatbot that can respond to the user's queries about programming languages. | codefeedback |
Given two strings, find the longest common substring between them.
s1 = "Hello, world!"
s2 = "world, goodbye!" | codefeedback |
Implement an autocomplete feature for an input field. | codefeedback |
Using MongoDB, create a database to store user information. | codefeedback |
Write a SQL query to display the name and most recent transaction date of top 5 customers. | codefeedback |
Edit the given MySQL query to return all employee details from the "employees" table having both salary and designation value "Manager".
SELECT * FROM employees; | codefeedback |
Generate input data for a convolutional neural network (CNN).
The CNN will classify objects in an image. | codefeedback |
Employ an algorithm to predict the customer churn rate.
A dataset containing customer data such as demographics, spending patterns, customer lifetime value and customer satisfaction. | codefeedback |
Implement a sorting algorithm in Python for the given data.
Data: [4, 2, 3, 8, 1] | codefeedback |
Using Django, develop a web application to manage a blog. | codefeedback |
Create a function that takes in two variables and checks if they have the same type. | codefeedback |
Create a function that takes in a number and returns all the prime factors.
num = 30 | codefeedback |
Create a function which will take in a string and returns a string in reverse order. | codefeedback |
Convert the following string of HTML into a DOM tree.
html_string = "<p>Hello <b>World</b></p>" | codefeedback |
Normalize the following URL
http://www.facebook.com/profile/pages? | codefeedback |
Write an array filter to remove any element with the value 0.
[0,1,2,3,4,0,6] | codefeedback |
Create a web application that allows users to search for movies and save their favorites. | codefeedback |
Generate all possible permutations of the characters in a given string | codefeedback |
Create a program in Python to generate a random number in the range from 0 to 10. | codefeedback |
Create a script in Java to find the most repeated element in an array.
Array in string form: “a,b,c,d,a,a,b,d,d” | codefeedback |
You need to parse a given HTML string and obtain the list of tags in the string.
html_string = "<div> <h1>Hello World!</h1> <p>This is a HTML string.</p> </div>" | codefeedback |
Create a function in Python to generate all possible strings of length k from given lowercase characters.
set = {'a', 'b', 'c'}
k = 3 | codefeedback |
You need to edit the given code for sorting. Make the array sort in descending order.
arr = [3, 5, 8, 9, 10] | codefeedback |
You need to write an API request in Python to return JSON data from an API endpoint. | codefeedback |
Write an algorithm to sort a list of numbers from least to greatest. | codefeedback |
Construct an algorithm to find the longest common prefix string amongst an array of strings.
`<code>['leet', 'leets', 'lee', 'leeston', 'leeve']</code>` | codefeedback |
Construct a program to print the Pyramid pattern using asterisks. | codefeedback |
Construct a function to set up a dictionary with words and corresponding counts of occurrences of each word.
`<code>'hey hey hello hello hell oh hello',</code>` | codefeedback |
Given a sorted list of integers, write a Python function to search for a specific target element. | codefeedback |
Modify the existing code so it prints out the numbers from 0 to 10 in reverser order.
for (let i = 0; i < 10; i++) {
console.log(i);
} | codefeedback |
Develop a program for sorting an array of numbers.
arr = [40, 10, 5, 50, 30] | codefeedback |
Improve the code to return the sum of all the numbers in the given vector.
vector<float> nums = {1.5, 2.5, 3.5, 4.5}; | codefeedback |
Create an SQL query that joins two tables, Orders and Customers, and returns a list of customers who have ordered something in the last month. | codefeedback |
Perform an left outer join of two tables, Customers and Orders, in an SQL query and order the result by CustomerName in ascending order. | codefeedback |
Create a class in Python to represent a book with the title, author and year of publication as attributes. | codefeedback |
Generate an algorithm to perform the task described below
Given two strings, find out if one string is a rotation of other. | codefeedback |
What is a use case for inheritance in object-oriented programming? | codefeedback |
What is the advantage of using Dynamic programming over Greedy algorithms? | codefeedback |
Create a recursive function that returns the Fibonacci number corresponding to a given input. | codefeedback |
How many unique elements are present in the given array?
arr = [1, 2, 2, 3, 3, 3, 4, 4, 4, 4] | codefeedback |
Reorder a given array such that all even elements are placed before odd elements.
arr = [1, 2, 3, 4, 5, 6, 7, 8] | codefeedback |
Write a C++ program to print out the first 5 lines of the Pascal Triangle. | codefeedback |
Write a query in MongoDB to search for documents where the address field contains the string "California". | codefeedback |
Sort a given array using quicksort algorithm.
arr = [3, 2, 9, 10, 1] | codefeedback |
Create a Python function to generate the first n prime numers. | codefeedback |
Compute the occurrence of each character in a given string.
my_string = "Hello World!" | codefeedback |
Modify the following Python code to make it run faster
def roll_dice(n):
values = []
for i in range(n):
values.append(random.randint(1,6))
return values | codefeedback |
Create a PHP script that prints out the sum of all even numbers | codefeedback |
Write a SELECT SQL statement to display the employee name and department in descending order of salary. | codefeedback |
Code an if statement in Java to check if an integer is odd | codefeedback |
Code a for loop in Java to find the maximum value in an array
int[] arr = {2,5,3,7,1}; | codefeedback |
Generate a random 16 character string. | codefeedback |
Determine the index of an element in a given array using binary search.
arr = [1, 2, 3, 4, 5, 6, 7]
element = 4 | codefeedback |
Create an algorithm to compute the sum of the digits of a given positive integer. | codefeedback |
Debug the following C++ code by finding and fixing errors.
int findMax(int arr[], int n)
{
if(arr[i] < n)
{
int max = arr[i];
for (int i = 0; i < n; i++)
if (arr[I] > max)
max = arr[i];
return max;
}
} | codefeedback |
Design a efficient algorithm to check if two tree structures are identical at the root node level. | codefeedback |
Unwrap the value in the following nested tuple.
my_tuple = ((1, (2, (3, 4))), 5) | codefeedback |
Create an algorithm in pseudocode to find the maximum value in an array. | codefeedback |
Write a function in JavaScript to delete duplicate characters from a string.
String: "google" | codefeedback |
Debug the given Python code and make sure that it runs without errors.
def add_two_numbers(a, b):
return a b | codefeedback |
Construct a function in C++ to check if two numbers are co-prime or not. | codefeedback |
Modify the Python code below to solve the following error: "TypeError: 'str' object is not callable".
"""
def greet(name):
print('Hello', name())
greet('John')
""" | codefeedback |
Implement a neural network that classifies an MNIST digit into one of the 10 classes. | codefeedback |
Create a method in JavaScript to convert a string to camel case. | codefeedback |
Convert a given string in the form of a camelCase notation to snake_case notation
camelCaseString | codefeedback |
Design a system that can take an integer list as its input and return a sorted list
[70, 2, 8, 45, 23] | codefeedback |
Calculate the factorial of a positive integer in C. | codefeedback |
Write a SQL query to retrieve the highest paid employee. | codefeedback |
Explain the purpose and implementation of the media query. | codefeedback |
Write a Bash script to print the largest number in an array.
array=(51 72 23 39 52) | codefeedback |
Classify the given text into either positive or negative sentiment.
This movie was one of the worst movies I've ever seen. | codefeedback |
Design a class in Java to represent a bank account. | codefeedback |
Write a function in JavaScript to validate a credit card number. | codefeedback |
Create a web crawler to extract all the links within a given web page
url = "https://www.example.com" | codefeedback |
Unpack a given list of tuples
tuples = [('John', 23), ('Adam', 45)] | codefeedback |
Generate a valid HTML markup from the given JSON data.
{
"name": "Sample Name",
"city": "New Delhi",
"state": "Delhi"
} | codefeedback |
Create a Python function to generate all prime numbers less than a given number. | codefeedback |
Sort the given list of integers in descending order using the Bubble sort technique.
[3, 5, 2, 8, 9, 1] | codefeedback |
Retrieve the data of the third item from the given list.
[{"name":"Mary","age":27,"city":"NY"},{"name":"David","age":35,"city":"LA"},{"name":"John","age":22,"city":"Uk"}] | codefeedback |
Write a validation code to verify if a given string is an integer. | codefeedback |
Write a code snippet in Javascript to print out the alphabetical characters in a string.
var myString = "Taichi Tamura" | codefeedback |
Develop an algorithm to find the maximum number of overlapping intervals.
[[2, 3], [1, 5], [7, 10]] | codefeedback |
Write a query to find the number of students enrolled in each class each semester.
Table Name: enroll
Fields: enroll_id, student_id, class_id, semester | codefeedback |
Create a hash table in C with 5 elements. | codefeedback |
Replace all words with 4 letters or more with "*****" in the following text.
This is an example of text. | codefeedback |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.