instruction_seed stringlengths 38 11.4k | source stringclasses 1
value | embeddings sequencelengths 1.02k 1.02k | mean_positive_score float64 0.76 0.86 | mean_negative_score float64 0.7 0.81 | difference_score float64 0.04 0.08 |
|---|---|---|---|---|---|
Increase the difficulty of the given programming test question by adding additional requirements and constraints.
Write a function called factorial that takes in a positive integer number as a parameter. The function should validate that the input is a positive integer and throw an error if it is not.
Inside the fun... | codefeedback | [
0.019473284482955933,
0.04781191051006317,
-0.014615541324019432,
-0.022036809474229813,
0.03908626735210419,
-0.021067572757601738,
-0.022738995030522346,
0.05916142091155052,
0.036588337272405624,
-0.0011904294369742274,
-0.0023209531791508198,
0.02612525410950184,
-0.0341310016810894,
-... | 0.83238 | 0.786078 | 0.046302 |
Given a list of integers, find the maximum of three integers without using any comparison operator or any built-in functions. The list will always contain exactly three integers. | codefeedback | [
0.0391293540596962,
0.02696438878774643,
-0.022588223218917847,
-0.028248673304915428,
0.047248467803001404,
-0.010148710571229458,
-0.02605995163321495,
0.03238450735807419,
0.025053080171346664,
-0.05193701013922691,
0.020899537950754166,
0.05632937699556351,
-0.02274252660572529,
-0.039... | 0.832571 | 0.78956 | 0.043012 |
Develop a program to generate the Fibonacci sequence up to the nth term.
Requirements:
1. The program should be able to handle large values of n, up to 10^9.
2. The program should have a time complexity of O(n) or better.
3. The program should use constant space, i.e., it should not use any additional data structures ... | codefeedback | [
0.02288675121963024,
0.02603011578321457,
-0.024322716519236565,
-0.029213761910796165,
0.030357828363776207,
-0.03386596217751503,
-0.033924784511327744,
0.0692877322435379,
0.025107279419898987,
-0.027722377330064774,
0.031675420701503754,
0.03415379673242569,
-0.036371421068906784,
-0.0... | 0.82995 | 0.784454 | 0.045496 |
Formulate a C++ code:
An irregularly shaped array named 'data' is given. This two-dimensional array is comprised of various sub-arrays of random lengths. Also, it is important to note the presence of a string value 'x'. Your assignation is to craft a function that unveils the occurrences of 'x' inside the irregularly ... | codefeedback | [
-0.006623959634453058,
0.026580967009067535,
-0.030733279883861542,
-0.022619185969233513,
0.020561443641781807,
-0.009407153353095055,
-0.023709770292043686,
0.0997774675488472,
0.03698284551501274,
-0.01477427501231432,
0.01710256189107895,
0.023789750412106514,
-0.025044109672307968,
-0... | 0.810593 | 0.766949 | 0.043645 |
You should create a Java program to implement a binary search with a twist. Instead of searching for a specific value in a sorted array, your program should search for a range of values within the array.
The program should take an input array of integers and two target values: lower and upper. It should then return th... | codefeedback | [
-0.006391511764377356,
0.02960084192454815,
-0.030933450907468796,
0.005216487683355808,
0.02285703830420971,
-0.028066961094737053,
-0.0246595311909914,
0.046027444303035736,
0.02925114892423153,
-0.02315252274274826,
0.019700337201356888,
-0.004201150499284267,
-0.0263036098331213,
-0.00... | 0.822142 | 0.771391 | 0.050751 |
Apply a bubble sort algorithm to the provided sequence of numbers.
Sequence: [17, 2, 11, 6, 13] | codefeedback | [
0.03618873283267021,
0.021128961816430092,
-0.01465730369091034,
-0.03788088262081146,
0.02908625453710556,
-0.01937486045062542,
-0.03385872393846512,
0.05976898968219757,
0.011717095039784908,
0.00747683783993125,
0.015669358894228935,
0.04705696925520897,
-0.03790752962231636,
-0.016007... | 0.824541 | 0.767208 | 0.057333 |
Find out the biggest prime number from a list of N integers, where N can be up to 10^7. The integers in the list can range from 1 to 10^9. Additionally, the algorithm should have a time complexity of O(N), a space complexity of O(1), and should be implemented using a recursive approach. | codefeedback | [
0.04504343494772911,
0.031056487932801247,
-0.01212659478187561,
-0.052617743611335754,
0.022207653149962425,
-0.018667345866560936,
-0.028621528297662735,
0.044420912861824036,
0.023064838722348213,
-0.020591242238879204,
0.037630755454301834,
0.026854731142520905,
-0.030736902728676796,
... | 0.829496 | 0.776889 | 0.052607 |
You are given a Python function that takes a list `nearest_neighbours` as input. The function is designed to find the most frequently occurring element in the list and return it. The function uses a dictionary `labels` to keep track of the frequency of each element in the input list. If an element is not already in the... | codefeedback | [
0.02506554126739502,
0.046750035136938095,
-0.029656684026122093,
-0.03242240101099014,
0.03862142562866211,
-0.008451920002698898,
-0.031190069392323494,
0.05316392704844475,
0.021592695266008377,
0.01017438992857933,
0.0322544239461422,
0.02820698544383049,
-0.015239285305142403,
0.02358... | 0.804015 | 0.757699 | 0.046316 |
"Print all powers of 2 less than or equal to n, along with their binary representations. Additionall(...TRUNCATED) | codefeedback | [0.01080405618995428,0.0406571701169014,-0.03454771265387535,-0.03459352254867554,0.0385687686502933(...TRUNCATED) | 0.826864 | 0.771912 | 0.054953 |
"Formulate a piece of Java programming code that confirms if a given numerical input is a Fibonacci (...TRUNCATED) | codefeedback | [-0.0014140954008325934,0.0009991578990593553,-0.034877799451351166,-0.02524416334927082,0.050080928(...TRUNCATED) | 0.816776 | 0.77234 | 0.044436 |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 8