instruction_seed stringlengths 0 26.4k | source stringclasses 4
values |
|---|---|
Create a function to sort a given array using selection sort.
arr = [5, 8, 1, 7, 2, 10, 3] | codefeedback |
Manipulate the spreadsheet with Python to identify duplicates in column A. | codefeedback |
Write a parser to convert an XML document to a dictionary. | codefeedback |
Generate code to create a 3 x 3 matrix with values 1 to 9. | codefeedback |
Write code to print the prime numbers in a given range. | codefeedback |
Generate a sorted list of numbers in an array using insertion sort?
arr = [5, 8, 1, 7, 2, 10, 3] | codefeedback |
Create a function to find the length of the longest substring that does not contain duplicate characters.
string = "abcabcefghijklmnop" | codefeedback |
Develop a Java program to rotate a two-dimensional array clockwise by 90 degrees.
[[1, 2],
[3, 4]] | codefeedback |
Write a Java method that takes a string and returns a copy of the string with all lowercase letters replaced with uppercase letters.
mixed case | codefeedback |
Implement a python function to return "true" if the string is a palindrome and "false" if it is not | codefeedback |
Generate a valid code to sum two given numbers | codefeedback |
Create a program to print the sum of all first 10 natural numbers. | codefeedback |
Create a code to check if a number is an Armstrong number or not | codefeedback |
Using the MapReduce programming model, calculate the total number of purchases in a given dataset. | codefeedback |
Write a function that creates a random 4 digit pin using the following criteria: | codefeedback |
Generate a list of prime numbers between two numbers A and B (both inclusive). | codefeedback |
Develop a classifier in Python to predict the language of a given text. | codefeedback |
Generate a function to sort a 2-dimensional list in Python by the values of the second element in each sublist. | codefeedback |
Find the kth smallest element in an array. The array consists of integers only and the size of the array is given. | codefeedback |
Construct a network to recognize handwritten digits using a convolutional neural network in TensorFlow. | codefeedback |
Create an SQL query to get the average of all the prices in the products table. | codefeedback |
Write a SQL query to select all Colleges from the table "Universities" whose enrollment is higher than 10,000 students. | codefeedback |
Convert the following JSON data to an HTML table.
{
"fruit": ["apple", "banana", "orange"],
"vegetable": ["potato", "carrot", "onion"]
} | codefeedback |
Develop a function to remove the given string from another string.
String to remove: "cat"
String to modify: "The crazy cat jumped to the roof" | codefeedback |
Develop a program to generate the Fibonacci sequence up to n. | codefeedback |
Write a Java program to sort the following array of integers using Quick Sort.
int arr[] = {4, 3, 6, 2, 5, 1}; | codefeedback |
Design a database schema to track course registrations in a university. | codefeedback |
Write a Swift code snippet to add two objects of any data type. | codefeedback |
Write a PHP code to find the first day of the current month. | codefeedback |
Suggest an algorithm to solve a N queens problem. | codefeedback |
Write a CSS code to make list items to have a blue background color and a text color of green. | codefeedback |
Design a WebGL program to generate a snow flake effect in the browser. | codefeedback |
Design an algorithm to calculate the Fibonacci sequence up to a given number n. | codefeedback |
Write a method in C# for finding the longest common subsequence of two strings.
string s1 = "ABCDGHLQR";
string s2 = "AEDPHR"; | codefeedback |
How to write a query to select records from a MySQL table titled “Users” | codefeedback |
Write a code to check if the string has all unique characters in Python | codefeedback |
Create an iOS app that calculates and shows the currency conversion rate between two different countries. | codefeedback |
Change the following code so that it will only return the words that contain more than 5 characters.
def get_words(text):
return text.split(" ") | codefeedback |
How would you solve the following problem: Given a list of numbers, find the two numbers that add up to a given sum?
[3, 6, 2, 8, 4], sum = 10 | codefeedback |
Write a SQL query to find customers from USA and order the list by their total purchases in descending order. | codefeedback |
Write a Python function that validates a given credit card number. | codefeedback |
Create a function that converts a given number of days into a more readable format of years, months and days. | codefeedback |
Write a Python function to return an array of adjacent (horizontal and vertical) numbers of a given two-dimensional array.
[[1, 2, 3],
[4, 5, 6],
[7, 8, 9]] | codefeedback |
Write a TensorFlow script to build a 3-layer neural network classifier. | codefeedback |
Create a function to output a nested dictionary from a given list of keys and values.
list_keys = ["a", "b", "c"]
list_vals = [1, 2, 3] | codefeedback |
Write a function to parse a given string and construct a dictionary which contains each word and the corresponding frequency.
my_string = 'Hello World' | codefeedback |
Create a function to count the number of characters in a string, without using the len() function. | codefeedback |
Write a function to find the highest prime number that can be divided by a given number. | codefeedback |
Describe an effective way to debug a JavaScript program. | codefeedback |
Generate a valid regex pattern that finds instances of the word “unicorn” appearing at the end of a sentence. | codefeedback |
Create a JavaScript program to validate an IP address. | codefeedback |
Write a sql query to list all customers with phone numbers that start with a 6 or 7. | codefeedback |
How can we make the following model more efficient?
import keras
from keras.models import Sequential
from keras.layers import Dense, Flatten
model = Sequential()
model.add(Dense(32, activation='relu', input_dim=128))
model.add(Dense(32, activation='relu'))
model.add(Flatten())
model.add(Dense(1, activation='sigmoid')) | codefeedback |
Implement a function that will sort the array using insertion sort.
nums=[5,2,4,6,1,3] | codefeedback |
Write a code that performs binary search on a given list.
my_array = [1,3,5,7,9] | codefeedback |
Implement a code that will group a series of numbers into groups of three.
nums = [1, 2, 3, 4, 5, 6] | codefeedback |
Create a MySQL query to return a distinct list of customers who have purchased productid 120 | codefeedback |
Design a class in Java to build a Binary Search Tree. | codefeedback |
Write a Python script to print out the max and min values from the given list.
[2,10,18,24,36,95] | codefeedback |
How can we increment the counter by 20 without manually specifying the value 20?
counter = 0 | codefeedback |
How can we evaluate a given Python expression dynamically? | codefeedback |
Output all the prime numbers between 1 and 50. | codefeedback |
Write a TensorFlow code to classify MNIST. | codefeedback |
Write a regular expression to match all valid UK postcodes. | codefeedback |
Create a function in Scala that takes a parameter x and returns the square of x. | codefeedback |
Generate code to create an array of 5 random integers between 0 and 10. | codefeedback |
What is the algorithm complexity of Insertion Sort? | codefeedback |
What is the difference between preemptive multitasking and non-preemptive multitasking? | codefeedback |
Generate a unique 10-character password which includes both alphabets and digits. | codefeedback |
Train a machine learning model for text categorization with an input text and labels.
Text = "This is an example of text"
Labels = ["example", "text"] | codefeedback |
Generate a C code to calculate the power of a given number. | codefeedback |
Generate a Java code to display the multiplication table from 1 to 10. | codefeedback |
Create an algorithm to calculate the Fibonacci series up to n numbers where n is a given number. | codefeedback |
Develop a C++ program for finding the area of a circle.
4 | codefeedback |
Write a code in Java for finding the factorial of a number.
5 | codefeedback |
Generate a random alphanumeric string of length 8 in Java. | codefeedback |
How would you remove all punctuation marks in a given string? | codefeedback |
Suggest a way to explore a large dataset efficiently in Python. | codefeedback |
Create a guide to explain the usage of the built-in Python sort() function. | codefeedback |
Write a C++ function to calculate the maximum subarray sum of a given array. | codefeedback |
Write a JavaScript function to randomize the order of elements in an array
array = ["dog", "cat", "horse", "elephant"] | codefeedback |
Write a python snippet to reverse the words in a sentence.
This sentence should be reversed. | codefeedback |
Find the second highest value in the given array.
[9, 2, 7, 4, 11, 6] | codefeedback |
How to find the minimum number in an array of integers in Java? | codefeedback |
Given a numeric array and a length, find the longest increasing subsequence in the array.
Array: [3, 4, 1, 5, 10, 9, 8, 11]
Length: 8 | codefeedback |
How would you write a code to calculate the area of a circle given a radius r? | codefeedback |
Write a function in JavaScript to remove all vowels from an input string. | codefeedback |
Create an recursive algorithm in Python to find the nth number in Fibonacci sequence. | codefeedback |
What is an example of a bubble sort algorithm? | codefeedback |
Write a SQL query to retrieve players with a score equal to or greater than 80.
CREATE TABLE `players` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(30) NOT NULL,
`score` int(11) NOT NULL,
PRIMARY KEY(`id`)
); | codefeedback |
Design a PHP code for displaying the current URL. | codefeedback |
Write a code in Go that checks if a number is prime or not. | codefeedback |
Generate an algorithm to create a Palindrome | codefeedback |
Generate an SQL query to retrieve the data
Retrieve the name and salary of employees whose salary is more than $50000 | codefeedback |
Create a C++ program to solve this problem
Given an array of integers, count the number of pairs of integers whose difference is K.
Example:
Input: array = [1, 7, 5, 9, 2, 12, 3], k = 2
Output: 4 | codefeedback |
Write a regex expression that checks if the input string contains only numerical values. | codefeedback |
How would you code a function that takes a string and returns true if it is a palindrome, and false otherwise? | codefeedback |
Given a matrix of size m x n, transpose it.
matrix = [[1, 2, 3],
[4, 5, 6],
[7, 8, 9]] | codefeedback |
Given an array of strings, find the longest common prefix string.
arr = ["Code", "Coder", "Codecademy", "Codesigner"] | codefeedback |
Create a program that sorts an array of integers in ascending order.
arr = [5, 9, 1, 4, 3] | codefeedback |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.