instruction_seed stringlengths 0 26.4k | source stringclasses 4
values |
|---|---|
Write a code to create a list that preserves the order of the original input and contains only the odd numbers from it?
[1,2,3,4,5,6,7,8,9] | codefeedback |
Write a function that takes an integer parameter and find the maximum of the three numbers with the help of ternary operator. | codefeedback |
Construct a SQL query to select the orders with order_num >= 1000. | codefeedback |
Given a string s and an integer k, write a code to find the kth most frequent element in the string
String s: "hello world hello"
Integer k: 2 | codefeedback |
Create a program to convert a given time in GMT form to local time. | codefeedback |
Create a list comprehension that prints each pair in a given list of tuples.
my_list = [("apple", "red"), ("banana", "yellow")] | codefeedback |
Rewrite the following code snippet so that it is compatible with Python 3
sum = 0
for num in range(10):
sum = sum + num
print sum | codefeedback |
Write a user authentication code in Python | codefeedback |
Combine a loop and a conditional statement to output the following
[2, 3, 4, 5] | codefeedback |
Fill in the blanks to calculate the standard deviation of an array using the formula. | codefeedback |
Identify an ideal algorithm to find the longest palindrome in a given string. | codefeedback |
Develop an AI Assistant to identify questions in a given sentence. | codefeedback |
Create a class with two methods, one to return the name and the other to return the age. | codefeedback |
Using SQL, write a query to find the maximum price of a product in the database. | codefeedback |
Create a nested For loop in Python with the outer loop counting from 0 to 3 and the inner loop counting from 5 to 10. | codefeedback |
Create a function to add two integers in assembly language. | codefeedback |
Suggest an edit to fix the following code snippet.
for num in range(10):
if num % 2 == 0
print(num); | codefeedback |
Create a SQL query to find the employees who live in California and earn more than $80,000 per year. | codefeedback |
How would you implement Skip-Gram model in TensorFlow? | codefeedback |
How would you reverse the order of the elements in a given singly linked list in-place? | codefeedback |
Create a class in Python which models a bank account using the concept of class and object. | codefeedback |
Write a regex pattern to match a float number with at least one decimal place. | codefeedback |
Write a C++ function to remove all the duplicates in a given array. | codefeedback |
Parse and save the following article in a dataset.
"The Boston Celtics have signed forward Gordon Hayward to a four-year deal.
Good move from the Celtics, who are coming off of a teams worst record since 2007?
The 29-year-old Hayward has averaged 10.7 points and 5 rebounds per game in his eight-year career" | codefeedback |
Suggest a use case for natural language processing in healthcare. | codefeedback |
Write a SQL query to find the average price of the products in a given product type. | codefeedback |
Rank a list of integer from high to low
[2, 5, 8, 3, 9, 6] | codefeedback |
Create a C++ program for grading system | codefeedback |
Generate a class in java to convert Fahrenheit to Celsius | codefeedback |
What are the differences between a Java applet and a Java application? | codefeedback |
Create a Linux shell command to find out the total disk space available in a given mount point | codefeedback |
Given a text string modify it by capitalizing the letters after a period.
hello world. this is from gpt | codefeedback |
Create an array of integers that contain all the prime numbers between 1 and 50 | codefeedback |
Build a state machine in Python to process incoming keyboard events | codefeedback |
Write a function that returns the larger number from two numbers provided.
4, 5 | codefeedback |
Write a code that returns a 2-dimensional array of size n by m containing all 0s
n = 3 and m = 5 | codefeedback |
Write a function that takes in a string and returns a list of all words in the string in alphabetical order
str = "Here is a sentence to sort" | codefeedback |
Generate a program to calculate the combination of n elements taken k at a time.
n = 8
k = 3 | codefeedback |
Modify the function such that it takes two arrays, one containing numbers and the other containing symbols as arguments and returns a string where each number is replaced with its associated symbol.
nums = [1,2,3,4,5]
symbols = ["A","B","C","D","E"] | codefeedback |
Create a function that evaluates a mathematical expression stored as a string.
expression = "1+2*3/4" | codefeedback |
Perform a search operation to find all the words starting with "th".
Sentence: The big cat ate the small mouse. | codefeedback |
Develop an algorithm to reverse an integer.
123 | codefeedback |
Develop an algorithm to find the depth in a tree. | codefeedback |
Determine if a given word is a valid word of English language.
Word: lycanthropy | codefeedback |
Categorize the given sentence into a specific class.
Sentence: It was a beautiful sunny day. | codefeedback |
Create a clould-based web application in Java to store financial details. | codefeedback |
Train a Naive Bayes model in Python to classify emails into spam and non-spam classes. | codefeedback |
Calculate the maximum sum of a subarray of length k.
Array: [1, 3, 4, 5, 20, 32]
K: 3 | codefeedback |
Calculate the sum of the cube of integers from 1 to n. | codefeedback |
Write a function to find the path from a source point to a destination point in a given 2D array.
Array: [[0, 1, 0, 0, 0], [0, 1, 0, 1, 0], [1, 0, 0, 1, 0], [0, 0, 0, 1, 0]]
Source Point: [0, 0]
Destination Point: [3, 4] | codefeedback |
Find the sum of the products of the digits of a given number with its reverse.
Number = 1234 | codefeedback |
Write a Python function to generate a random password with length 8 containing any combination of upper and lowercase letters, numbers, and symbols. | codefeedback |
Write a code to filter out the names longer than 5 characters from the following list.
data = ["James", "John", "Susan", "Bella", "Natalie", "Adam", "Sam", "Eric"] | codefeedback |
Write a code to generate all possible binary strings of length 5. | codefeedback |
Create a database to store customer data and products. | codefeedback |
Create a C++ function to determine the number of inversions in an array. | codefeedback |
Create a KMP algorithm in Python to find a pattern in a given text.
Text: abcabdababd
Pattern:abd | codefeedback |
Write a Scala function to generate a range of numbers. | codefeedback |
Write a function in Python to remove all 'null' values from a nested dictionary. | codefeedback |
Write a Python function that takes a list of integers and returns True if any of the integers is divisible by 7. | codefeedback |
Write a function to compare two strings and return the number of different characters in each string. | codefeedback |
Write a function to generate anagrams for a given string
str = "cat" | codefeedback |
Create a class for constructing a new tree | codefeedback |
Generate a password that is at least 8 characters long and contains at least one letter, one number, and one special character. | codefeedback |
Submit an optimized solution to the following leetcode problem.
Problem: Given two binary trees, write a function to check if they are the same or not.
Two binary trees are considered the same if they are structurally identical and the nodes have the same value. | codefeedback |
Write a Python function to convert a given Unix timestamp to a readable format like "day, month, date, hours:minutes:seconds, year". | codefeedback |
Train a machine learning algorithm to classify objects into one of two classes. | codefeedback |
Create a serverless application with AWS Lambda. | codefeedback |
Use Java to send an HTTP request to an API endpoint with a login form. | codefeedback |
Create a Java program that takes a list of integers as an argument and computes the longest increasing subsequence.
[8, 10, 1, 4, 15, 6, 7] | codefeedback |
Write a function in JavaScript to flatten the given array.
[1, [[2, 3], 4], 5, [6]] | codefeedback |
Build a script to print the words that have the most occurrences in a given string.
"This is just a simple string" | codefeedback |
Create a program that outputs a spiral array from the given input of a 2D array.
[[ 1, 2, 3 ],
[ 4, 5, 6 ],
[ 7, 8, 9]] | codefeedback |
Compute the sum of all integers from 1 to the given number n. | codefeedback |
Generate a summary of an article containing more than 500 words. | codefeedback |
Design an algorithm that computes the minimum number of moves taking an array of integers to a sorted array.
[1, 3, 5, 4, 2] | codefeedback |
Design a function to find the Fibonacci sequence numbers given n.
n = 5 | codefeedback |
Design a function to compute n^2-2n. | codefeedback |
Implement the algorithm to reverse a singly linked list. | codefeedback |
Write a Python script to check if two string variables are anagrams or not. | codefeedback |
Name a specific package that can be used to implement a REST API in Node.js | codefeedback |
Rewrite the following code segment using Java 1.8's Lambda Expressions.
BiFunction<Double, Double, Double> bf = new BiFunction<Double, Double, Double>() {
public Double apply(Double d1, Double d2) {
return (d1*d2)/2;
}
} | codefeedback |
Write code to create an SQLite table called "Students" with 5 columns: student_id, name, age, class, and grade. | codefeedback |
Implement a recursive function that finds the nth number in the Fibonacci sequence. | codefeedback |
Write a SQL query to get the names of all customers with orders that have a total cost greater than $100.
Table names: customers, orders
Table columns: customers(customer_id, customer_name), orders(order_id, customer_id, order_cost). | codefeedback |
Propose an algorithm in Python for sorting a given list of numbers in descending order. | codefeedback |
Create a function in Python to find all pairs of integers that sum up to k. | codefeedback |
Create a sorting algorithm to order a given array.
[ 2 , 8 , 3 , 10 , 16 ] | codefeedback |
How can you use a function to determine whether a given array is in increasing or decreasing order or unordered? | codefeedback |
Write a Python function to generate a list of Fibonacci numbers up to the given limit n. | codefeedback |
Create a basic Java program that implements a binary search tree. | codefeedback |
How would you design the data structure to store and process results from a 5-choice multiple choice test. | codefeedback |
How would you create a website that provides users with their daily horoscopes? | codefeedback |
Describe how you would use a dictionary to reverse a string. | codefeedback |
Convert the following enum type expression in Java for days of the week to equivalent C# syntax.
enum Weekday {SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY}; | codefeedback |
A function needs to be created that will take a list of strings and return a list of the same strings without duplicates.
list_of_strings = ["a", "b", "c", "a", "d"] | codefeedback |
Write a Python program to analyze the sentiment of a given text.
The restaurant food was terrible. | codefeedback |
How does the Fibonacci number sequence work? | codefeedback |
Describe the process of debugging a code. | codefeedback |
Design a network for sending data from a server to a client. | codefeedback |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.