name stringclasses 161
values | language stringclasses 22
values | prompt stringlengths 40 2.27k | doctests stringclasses 3
values | original stringclasses 956
values | prompt_terminology stringclasses 2
values | tests stringlengths 125 5.35k | stop_tokens listlengths 1 7 |
|---|---|---|---|---|---|---|---|
HumanEval_63_fibfib | cpp | #include<assert.h>
#include<bits/stdc++.h>
// The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:
// fibfib(0) == 0
// fibfib(1) == 0
// fibfib(2) == 1
// fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).
// Please write a function to efficiently compute the n-th e... | transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py | verbatim | }
int main() {
auto candidate = fibfib;
assert(candidate((2)) == (1));
assert(candidate((1)) == (0));
assert(candidate((5)) == (4));
assert(candidate((8)) == (24));
assert(candidate((10)) == (81));
assert(candidate((12)) == (274));
assert(candidate((14)) == (927));
}
| [
"\n}"
] |
HumanEval_64_vowels_count | cpp | #include<assert.h>
#include<bits/stdc++.h>
// Write a function vowels_count which takes a string representing
// a word as input and returns the number of vowels in the string.
// Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a
// vowel, but only when it is at the end of the given word.
// Example:... | transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py | verbatim | }
int main() {
auto candidate = vowels_count;
assert(candidate(("abcde")) == (2));
assert(candidate(("Alone")) == (3));
assert(candidate(("key")) == (2));
assert(candidate(("bye")) == (1));
assert(candidate(("keY")) == (2));
assert(candidate(("bYe")) == (1));
assert(candidate(("ACEDY")) ... | [
"\n}"
] |
HumanEval_65_circular_shift | cpp | #include<assert.h>
#include<bits/stdc++.h>
// Circular shift the digits of the integer x, shift the digits right by shift
// and return the result as a string.
// If shift > number of digits, return digits reversed.
// >>> circular_shift((12), (1))
// ("21")
// >>> circular_shift((12), (2))
// ("12")
std::string circul... | transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py | verbatim | }
int main() {
auto candidate = circular_shift;
assert(candidate((100), (2)) == ("001"));
assert(candidate((12), (2)) == ("12"));
assert(candidate((97), (8)) == ("79"));
assert(candidate((12), (1)) == ("21"));
assert(candidate((11), (101)) == ("11"));
}
| [
"\n}"
] |
HumanEval_66_digitSum | cpp | #include<assert.h>
#include<bits/stdc++.h>
// Task
// Write a function that takes a string as input and returns the sum of the upper characters only'
// ASCII codes.
// Examples:
// >>> digitSum((""))
// (0)
// >>> digitSum(("abAB"))
// (131)
// >>> digitSum(("abcCd"))
// (67)
// >>> digitSum(("helloE"))
// (69)
// >>>... | transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py | verbatim | }
int main() {
auto candidate = digitSum;
assert(candidate(("")) == (0));
assert(candidate(("abAB")) == (131));
assert(candidate(("abcCd")) == (67));
assert(candidate(("helloE")) == (69));
assert(candidate(("woArBld")) == (131));
assert(candidate(("aAaaaXa")) == (153));
assert(candidate(... | [
"\n}"
] |
HumanEval_67_fruit_distribution | cpp | #include<assert.h>
#include<bits/stdc++.h>
// In this task, you will be given a string that represents a number of apples and oranges
// that are distributed in a basket of fruit this basket contains
// apples, oranges, and mango fruits. Given the string that represents the total number of
// the oranges and apples ... | transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py | verbatim | }
int main() {
auto candidate = fruit_distribution;
assert(candidate(("5 apples and 6 oranges"), (19)) == (8));
assert(candidate(("5 apples and 6 oranges"), (21)) == (10));
assert(candidate(("0 apples and 1 oranges"), (3)) == (2));
assert(candidate(("1 apples and 0 oranges"), (3)) == (2));
asser... | [
"\n}"
] |
HumanEval_68_pluck | cpp | #include<assert.h>
#include<bits/stdc++.h>
// "Given an array representing a branch of a tree that has non-negative integer nodes
// your task is to pluck one of the nodes and return it.
// The plucked node should be the node with the smallest even value.
// If multiple nodes with the same smallest even value are found... | transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py | verbatim | }
int main() {
auto candidate = pluck;
assert(candidate((std::vector<long>({(long)4, (long)2, (long)3}))) == (std::vector<long>({(long)2, (long)1})));
assert(candidate((std::vector<long>({(long)1, (long)2, (long)3}))) == (std::vector<long>({(long)2, (long)1})));
assert(candidate((std::vector<long>())) =... | [
"\n}"
] |
HumanEval_69_search | cpp | #include<assert.h>
#include<bits/stdc++.h>
// You are given a non-empty list of positive integers. Return the greatest integer that is greater than
// zero, and has a frequency greater than or equal to the value of the integer itself.
// The frequency of an integer is the number of times it appears in the list.
// If... | transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py | verbatim | }
int main() {
auto candidate = search;
assert(candidate((std::vector<long>({(long)5, (long)5, (long)5, (long)5, (long)1}))) == (1));
assert(candidate((std::vector<long>({(long)4, (long)1, (long)4, (long)1, (long)4, (long)4}))) == (4));
assert(candidate((std::vector<long>({(long)3, (long)3}))) == (-1));... | [
"\n}"
] |
HumanEval_6_parse_nested_parens | cpp | #include<assert.h>
#include<bits/stdc++.h>
// Input to this function is a string represented multiple groups for nested parentheses separated by spaces.
// For each of the group, output the deepest level of nesting of parentheses.
// E.g. (()()) has maximum two levels of nesting while ((())) has three.
// >>> parse_nes... | transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py | verbatim | }
int main() {
auto candidate = parse_nested_parens;
assert(candidate(("(()()) ((())) () ((())()())")) == (std::vector<long>({(long)2, (long)3, (long)1, (long)3})));
assert(candidate(("() (()) ((())) (((())))")) == (std::vector<long>({(long)1, (long)2, (long)3, (long)4})));
assert(candidate(("(()(())(((... | [
"\n}"
] |
HumanEval_70_strange_sort_list | cpp | #include<assert.h>
#include<bits/stdc++.h>
// Given list of integers, return list in strange order.
// Strange sorting, is when you start with the minimum value,
// then maximum of the remaining integers, then minimum and so on.
// Examples:
// >>> strange_sort_list((std::vector<long>({(long)1, (long)2, (long)3, (long)... | transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py | verbatim | }
int main() {
auto candidate = strange_sort_list;
assert(candidate((std::vector<long>({(long)1, (long)2, (long)3, (long)4}))) == (std::vector<long>({(long)1, (long)4, (long)2, (long)3})));
assert(candidate((std::vector<long>({(long)5, (long)6, (long)7, (long)8, (long)9}))) == (std::vector<long>({(long)5, (... | [
"\n}"
] |
HumanEval_71_triangle_area | cpp | #include<assert.h>
#include<bits/stdc++.h>
// Given the lengths of the three sides of a triangle. Return the area of
// the triangle rounded to 2 decimal points if the three sides form a valid triangle.
// Otherwise return -1
// Three sides make a valid triangle when the sum of any two sides is greater
// than the th... | transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py | verbatim | }
int main() {
auto candidate = triangle_area;
assert(candidate((3), (4), (5)) == (6.0f));
assert(candidate((1), (2), (10)) == (float(-1)));
assert(candidate((4), (8), (5)) == (8.18f));
assert(candidate((2), (2), (2)) == (1.73f));
assert(candidate((1), (2), (3)) == (float(-1)));
assert(candi... | [
"\n}"
] |
HumanEval_72_will_it_fly | cpp | #include<assert.h>
#include<bits/stdc++.h>
// Write a function that returns True if the object q will fly, and False otherwise.
// The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.
// Example:
// >>> will_it_fly((std::vecto... | transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py | verbatim | }
int main() {
auto candidate = will_it_fly;
assert(candidate((std::vector<long>({(long)3, (long)2, (long)3})), (9)) == (true));
assert(candidate((std::vector<long>({(long)1, (long)2})), (5)) == (false));
assert(candidate((std::vector<long>({(long)3})), (5)) == (true));
assert(candidate((std::vector... | [
"\n}"
] |
HumanEval_73_smallest_change | cpp | #include<assert.h>
#include<bits/stdc++.h>
// Given an array arr of integers, find the minimum number of elements that
// need to be changed to make the array palindromic. A palindromic array is an array that
// is read the same backwards and forwards. In one change, you can change one element to any other element.
// ... | transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py | verbatim | }
int main() {
auto candidate = smallest_change;
assert(candidate((std::vector<long>({(long)1, (long)2, (long)3, (long)5, (long)4, (long)7, (long)9, (long)6}))) == (4));
assert(candidate((std::vector<long>({(long)1, (long)2, (long)3, (long)4, (long)3, (long)2, (long)2}))) == (1));
assert(candidate((std:... | [
"\n}"
] |
HumanEval_74_total_match | cpp | #include<assert.h>
#include<bits/stdc++.h>
// Write a function that accepts two lists of strings and returns the list that has
// total number of chars in the all strings of the list less than the other list.
// if the two lists have the same number of chars, return the first list.
// Examples
// >>> total_match((std:... | transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py | verbatim | }
int main() {
auto candidate = total_match;
assert(candidate((std::vector<std::string>()), (std::vector<std::string>())) == (std::vector<std::string>()));
assert(candidate((std::vector<std::string>({(std::string)"hi", (std::string)"admin"})), (std::vector<std::string>({(std::string)"hi", (std::string)"hi"}... | [
"\n}"
] |
HumanEval_75_is_multiply_prime | cpp | #include<assert.h>
#include<bits/stdc++.h>
// Write a function that returns true if the given number is the multiplication of 3 prime numbers
// and false otherwise.
// Knowing that (a) is less then 100.
// Example:
// >>> is_multiply_prime((30))
// (true)
// 30 = 2 * 3 * 5
bool is_multiply_prime(long a) {
| transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py | verbatim | }
int main() {
auto candidate = is_multiply_prime;
assert(candidate((5)) == (false));
assert(candidate((30)) == (true));
assert(candidate((8)) == (true));
assert(candidate((10)) == (false));
assert(candidate((125)) == (true));
assert(candidate((105)) == (true));
assert(candidate((126)) =... | [
"\n}"
] |
HumanEval_76_is_simple_power | cpp | #include<assert.h>
#include<bits/stdc++.h>
// Your task is to write a function that returns true if a number x is a simple
// power of n and false in other cases.
// x is a simple power of n if n**int=x
// For example:
// >>> is_simple_power((1), (4))
// (true)
// >>> is_simple_power((2), (2))
// (true)
// >>> is_simpl... | transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py | verbatim | }
int main() {
auto candidate = is_simple_power;
assert(candidate((16), (2)) == (true));
assert(candidate((143214), (16)) == (false));
assert(candidate((4), (2)) == (true));
assert(candidate((9), (3)) == (true));
assert(candidate((16), (4)) == (true));
assert(candidate((24), (2)) == (false))... | [
"\n}"
] |
HumanEval_77_iscube | cpp | #include<assert.h>
#include<bits/stdc++.h>
// Write a function that takes an integer a and returns True
// if this ingeger is a cube of some integer number.
// Note: you may assume the input is always valid.
// Examples:
// >>> iscube((1))
// (true)
// >>> iscube((2))
// (false)
// >>> iscube((-1))
// (true)
// >>> is... | transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py | verbatim | }
int main() {
auto candidate = iscube;
assert(candidate((1)) == (true));
assert(candidate((2)) == (false));
assert(candidate((-1)) == (true));
assert(candidate((64)) == (true));
assert(candidate((180)) == (false));
assert(candidate((1000)) == (true));
assert(candidate((0)) == (true));
... | [
"\n}"
] |
HumanEval_78_hex_key | cpp | #include<assert.h>
#include<bits/stdc++.h>
// You have been tasked to write a function that receives
// a hexadecimal number as a string and counts the number of hexadecimal
// digits that are primes (prime number, or a prime, is a natural number
// greater than 1 that is not a product of two smaller natural numbers... | transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py | verbatim | }
int main() {
auto candidate = hex_key;
assert(candidate(("AB")) == (1));
assert(candidate(("1077E")) == (2));
assert(candidate(("ABED1A33")) == (4));
assert(candidate(("2020")) == (2));
assert(candidate(("123456789ABCDEF0")) == (6));
assert(candidate(("112233445566778899AABBCCDDEEFF00")) =... | [
"\n}"
] |
HumanEval_79_decimal_to_binary | cpp | #include<assert.h>
#include<bits/stdc++.h>
// You will be given a number in decimal form and your task is to convert it to
// binary format. The function should return a string, with each character representing a binary
// number. Each character in the string will be '0' or '1'.
// There will be an extra couple of char... | transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py | verbatim | }
int main() {
auto candidate = decimal_to_binary;
assert(candidate((0)) == ("db0db"));
assert(candidate((32)) == ("db100000db"));
assert(candidate((103)) == ("db1100111db"));
assert(candidate((15)) == ("db1111db"));
}
| [
"\n}"
] |
HumanEval_7_filter_by_substring | cpp | #include<assert.h>
#include<bits/stdc++.h>
// Filter an input list of strings only for ones that contain given substring
// >>> filter_by_substring((std::vector<std::string>()), ("a"))
// (std::vector<std::string>())
// >>> filter_by_substring((std::vector<std::string>({(std::string)"abc", (std::string)"bacd", (std::st... | transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py | verbatim | }
int main() {
auto candidate = filter_by_substring;
assert(candidate((std::vector<std::string>()), ("john")) == (std::vector<std::string>()));
assert(candidate((std::vector<std::string>({(std::string)"xxx", (std::string)"asd", (std::string)"xxy", (std::string)"john doe", (std::string)"xxxAAA", (std::string... | [
"\n}"
] |
HumanEval_80_is_happy | cpp | #include<assert.h>
#include<bits/stdc++.h>
// You are given a string s.
// Your task is to check if the string is happy or not.
// A string is happy if its length is at least 3 and every 3 consecutive letters are distinct
// For example:
// >>> is_happy(("a"))
// (false)
// >>> is_happy(("aa"))
// (false)
// >>> is_hap... | transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py | verbatim | }
int main() {
auto candidate = is_happy;
assert(candidate(("a")) == (false));
assert(candidate(("aa")) == (false));
assert(candidate(("abcd")) == (true));
assert(candidate(("aabb")) == (false));
assert(candidate(("adb")) == (true));
assert(candidate(("xyy")) == (false));
assert(candidat... | [
"\n}"
] |
HumanEval_81_numerical_letter_grade | cpp | #include<assert.h>
#include<bits/stdc++.h>
// It is the last week of the semester and the teacher has to give the grades
// to students. The teacher has been making her own algorithm for grading.
// The only problem is, she has lost the code she used for grading.
// She has given you a list of GPAs for some students an... | transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py | verbatim | }
int main() {
auto candidate = numerical_letter_grade;
assert(candidate((std::vector<float>({(float)4.0f, (float)3, (float)1.7f, (float)2, (float)3.5f}))) == (std::vector<std::string>({(std::string)"A+", (std::string)"B", (std::string)"C-", (std::string)"C", (std::string)"A-"})));
assert(candidate((std::ve... | [
"\n}"
] |
HumanEval_82_prime_length | cpp | #include<assert.h>
#include<bits/stdc++.h>
// Write a function that takes a string and returns True if the string
// length is a prime number or False otherwise
// Examples
// >>> prime_length(("Hello"))
// (true)
// >>> prime_length(("abcdcba"))
// (true)
// >>> prime_length(("kittens"))
// (true)
// >>> prime_length(... | transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py | verbatim | }
int main() {
auto candidate = prime_length;
assert(candidate(("Hello")) == (true));
assert(candidate(("abcdcba")) == (true));
assert(candidate(("kittens")) == (true));
assert(candidate(("orange")) == (false));
assert(candidate(("wow")) == (true));
assert(candidate(("world")) == (true));
... | [
"\n}"
] |
HumanEval_83_starts_one_ends | cpp | #include<assert.h>
#include<bits/stdc++.h>
// Given a positive integer n, return the count of the numbers of n-digit
// positive integers that start or end with 1.
long starts_one_ends(long n) {
| transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py | verbatim | }
int main() {
auto candidate = starts_one_ends;
assert(candidate((1)) == (1));
assert(candidate((2)) == (18));
assert(candidate((3)) == (180));
assert(candidate((4)) == (1800));
assert(candidate((5)) == (18000));
}
| [
"\n}"
] |
HumanEval_84_solve | cpp | #include<assert.h>
#include<bits/stdc++.h>
// Given a positive integer N, return the total sum of its digits in binary.
// Example
// >>> solve((1000))
// ("1")
// >>> solve((150))
// ("110")
// >>> solve((147))
// ("1100")
// Variables:
// @N integer
// Constraints: 0 ≤ N ≤ 10000.
// Output:
// a string of binary numb... | transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py | verbatim | }
int main() {
auto candidate = solve;
assert(candidate((1000)) == ("1"));
assert(candidate((150)) == ("110"));
assert(candidate((147)) == ("1100"));
assert(candidate((333)) == ("1001"));
assert(candidate((963)) == ("10010"));
}
| [
"\n}"
] |
HumanEval_85_add | cpp | #include<assert.h>
#include<bits/stdc++.h>
// Given a non-empty list of integers lst. add the even elements that are at odd indices..
// Examples:
// >>> add((std::vector<long>({(long)4, (long)2, (long)6, (long)7})))
// (2)
long add(std::vector<long> lst) {
| transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py | verbatim | }
int main() {
auto candidate = add;
assert(candidate((std::vector<long>({(long)4, (long)88}))) == (88));
assert(candidate((std::vector<long>({(long)4, (long)5, (long)6, (long)7, (long)2, (long)122}))) == (122));
assert(candidate((std::vector<long>({(long)4, (long)0, (long)6, (long)7}))) == (0));
as... | [
"\n}"
] |
HumanEval_86_anti_shuffle | cpp | #include<assert.h>
#include<bits/stdc++.h>
// Write a function that takes a string and returns an ordered version of it.
// Ordered version of string, is a string where all words (separated by space)
// are replaced by a new word where all the characters arranged in
// ascending order based on ascii value.
// Note: You... | transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py | verbatim | }
int main() {
auto candidate = anti_shuffle;
assert(candidate(("Hi")) == ("Hi"));
assert(candidate(("hello")) == ("ehllo"));
assert(candidate(("number")) == ("bemnru"));
assert(candidate(("abcd")) == ("abcd"));
assert(candidate(("Hello World!!!")) == ("Hello !!!Wdlor"));
assert(candidate(("... | [
"\n}"
] |
HumanEval_87_get_row | cpp | #include<assert.h>
#include<bits/stdc++.h>
// You are given a 2 dimensional data, as a nested lists,
// which is similar to matrix, however, unlike matrices,
// each row may contain a different number of columns.
// Given lst, and integer x, find integers x in the list,
// and return list of tuples, [(x1, y1), (x2, y2)... | transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py | verbatim | }
int main() {
auto candidate = get_row;
assert(candidate((std::vector<std::vector<long>>({(std::vector<long>)std::vector<long>({(long)1, (long)2, (long)3, (long)4, (long)5, (long)6}), (std::vector<long>)std::vector<long>({(long)1, (long)2, (long)3, (long)4, (long)1, (long)6}), (std::vector<long>)std::vector<lo... | [
"\n}"
] |
HumanEval_88_sort_array | cpp | #include<assert.h>
#include<bits/stdc++.h>
// Given an array of non-negative integers, return a copy of the given array after sorting,
// you will sort the given array in ascending order if the sum( first index value, last index value) is odd,
// or sort it in descending order if the sum( first index value, last index ... | transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py | verbatim | }
int main() {
auto candidate = sort_array;
assert(candidate((std::vector<long>())) == (std::vector<long>()));
assert(candidate((std::vector<long>({(long)5}))) == (std::vector<long>({(long)5})));
assert(candidate((std::vector<long>({(long)2, (long)4, (long)3, (long)0, (long)1, (long)5}))) == (std::vecto... | [
"\n}"
] |
HumanEval_89_encrypt | cpp | #include<assert.h>
#include<bits/stdc++.h>
// Create a function encrypt that takes a string as an argument and
// returns a string encrypted with the alphabet being rotated.
// The alphabet should be rotated in a manner such that the letters
// shift down by two multiplied to two places.
// For example:
// >>> encryp... | transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py | verbatim | }
int main() {
auto candidate = encrypt;
assert(candidate(("hi")) == ("lm"));
assert(candidate(("asdfghjkl")) == ("ewhjklnop"));
assert(candidate(("gf")) == ("kj"));
assert(candidate(("et")) == ("ix"));
assert(candidate(("faewfawefaewg")) == ("jeiajeaijeiak"));
assert(candidate(("hellomyfrie... | [
"\n}"
] |
HumanEval_8_sum_product | cpp | #include<assert.h>
#include<bits/stdc++.h>
// For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.
// Empty sum should be equal to 0 and empty product should be equal to 1.
// >>> sum_product((std::vector<long>()))
// (std::make_tuple(0, 1))
// >>> sum_product((s... | transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py | verbatim | }
int main() {
auto candidate = sum_product;
assert(candidate((std::vector<long>())) == (std::make_tuple(0, 1)));
assert(candidate((std::vector<long>({(long)1, (long)1, (long)1}))) == (std::make_tuple(3, 1)));
assert(candidate((std::vector<long>({(long)100, (long)0}))) == (std::make_tuple(100, 0)));
... | [
"\n}"
] |
HumanEval_90_next_smallest | cpp | #include<assert.h>
#include<bits/stdc++.h>
// You are given a list of integers.
// Write a function next_smallest() that returns the 2nd smallest element of the list.
// Return None if there is no such element.
// >>> next_smallest((std::vector<long>({(long)1, (long)2, (long)3, (long)4, (long)5})))
// 2
// >>> next_sma... | transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py | verbatim | }
int main() {
auto candidate = next_smallest;
assert(candidate((std::vector<long>({(long)1, (long)2, (long)3, (long)4, (long)5}))) == 2);
assert(candidate((std::vector<long>({(long)5, (long)1, (long)4, (long)3, (long)2}))) == 2);
assert(candidate((std::vector<long>())) == std::nullopt);
assert(cand... | [
"\n}"
] |
HumanEval_91_is_bored | cpp | #include<assert.h>
#include<bits/stdc++.h>
// You'll be given a string of words, and your task is to count the number
// of boredoms. A boredom is a sentence that starts with the word "I".
// Sentences are delimited by '.', '?' or '!'.
// For example:
// >>> is_bored(("Hello world"))
// (0)
// >>> is_bored(("The sky is... | transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py | verbatim | }
int main() {
auto candidate = is_bored;
assert(candidate(("Hello world")) == (0));
assert(candidate(("Is the sky blue?")) == (0));
assert(candidate(("I love It !")) == (1));
assert(candidate(("bIt")) == (0));
assert(candidate(("I feel good today. I will be productive. will kill It")) == (2));
... | [
"\n}"
] |
HumanEval_92_any_int | cpp | #include<assert.h>
#include<bits/stdc++.h>
// Create a function that takes 3 numbers.
// Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.
// Returns false in any other cases.
// Examples
// >>> any_int((float(5)), (float(2)), (float(7)))
// (true)
// >>> any_int((fl... | transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py | verbatim | }
int main() {
auto candidate = any_int;
assert(candidate((float(2)), (float(3)), (float(1))) == (true));
assert(candidate((2.5f), (float(2)), (float(3))) == (false));
assert(candidate((1.5f), (float(5)), (3.5f)) == (false));
assert(candidate((float(2)), (float(6)), (float(2))) == (false));
asse... | [
"\n}"
] |
HumanEval_93_encode | cpp | #include<assert.h>
#include<bits/stdc++.h>
// Write a function that takes a message, and encodes in such a
// way that it swaps case of all letters, replaces all vowels in
// the message with the letter that appears 2 places ahead of that
// vowel in the english alphabet.
// Assume only letters.
// Examples:
// >>... | transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py | verbatim | }
int main() {
auto candidate = encode;
assert(candidate(("TEST")) == ("tgst"));
assert(candidate(("Mudasir")) == ("mWDCSKR"));
assert(candidate(("YES")) == ("ygs"));
assert(candidate(("This is a message")) == ("tHKS KS C MGSSCGG"));
assert(candidate(("I DoNt KnOw WhAt tO WrItE")) == ("k dQnT kN... | [
"\n}"
] |
HumanEval_94_skjkasdkd | cpp | #include<assert.h>
#include<bits/stdc++.h>
// You are given a list of integers.
// You need to find the largest prime value and return the sum of its digits.
// Examples:
// >>> skjkasdkd((std::vector<long>({(long)0, (long)3, (long)2, (long)1, (long)3, (long)5, (long)7, (long)4, (long)5, (long)5, (long)5, (long)2, (lon... | transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py | verbatim | }
int main() {
auto candidate = skjkasdkd;
assert(candidate((std::vector<long>({(long)0, (long)3, (long)2, (long)1, (long)3, (long)5, (long)7, (long)4, (long)5, (long)5, (long)5, (long)2, (long)181, (long)32, (long)4, (long)32, (long)3, (long)2, (long)32, (long)324, (long)4, (long)3}))) == (10));
assert(can... | [
"\n}"
] |
HumanEval_95_check_dict_case | cpp | #include<assert.h>
#include<bits/stdc++.h>
// Given a dictionary, return True if all keys are strings in lower
// case or all keys are strings in upper case, else return False.
// The function should return False is the given dictionary is empty.
// Examples:
// >>> check_dict_case((std::map<std::string,std::string>({... | transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py | verbatim | }
int main() {
auto candidate = check_dict_case;
assert(candidate((std::map<std::string,std::string>({{"p", "pineapple"}, {"b", "banana"}}))) == (true));
assert(candidate((std::map<std::string,std::string>({{"p", "pineapple"}, {"A", "banana"}, {"B", "banana"}}))) == (false));
assert(candidate((std::map<... | [
"\n}"
] |
HumanEval_96_count_up_to | cpp | #include<assert.h>
#include<bits/stdc++.h>
// Implement a function that takes an non-negative integer and returns an array of the first n
// integers that are prime numbers and less than n.
// for example:
// >>> count_up_to((5))
// (std::vector<long>({(long)2, (long)3}))
// >>> count_up_to((11))
// (std::vector<long>(... | transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py | verbatim | }
int main() {
auto candidate = count_up_to;
assert(candidate((5)) == (std::vector<long>({(long)2, (long)3})));
assert(candidate((6)) == (std::vector<long>({(long)2, (long)3, (long)5})));
assert(candidate((7)) == (std::vector<long>({(long)2, (long)3, (long)5})));
assert(candidate((10)) == (std::vect... | [
"\n}"
] |
HumanEval_97_multiply | cpp | #include<assert.h>
#include<bits/stdc++.h>
// Complete the function that takes two integers and returns
// the product of their unit digits.
// Assume the input is always valid.
// Examples:
// >>> multiply((148), (412))
// (16)
// >>> multiply((19), (28))
// (72)
// >>> multiply((2020), (1851))
// (0)
// >>> multiply... | transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py | verbatim | }
int main() {
auto candidate = multiply;
assert(candidate((148), (412)) == (16));
assert(candidate((19), (28)) == (72));
assert(candidate((2020), (1851)) == (0));
assert(candidate((14), (-15)) == (20));
assert(candidate((76), (67)) == (42));
assert(candidate((17), (27)) == (49));
assert... | [
"\n}"
] |
HumanEval_98_count_upper | cpp | #include<assert.h>
#include<bits/stdc++.h>
// Given a string s, count the number of uppercase vowels in even indices.
// For example:
// >>> count_upper(("aBCdEf"))
// (1)
// >>> count_upper(("abcdefg"))
// (0)
// >>> count_upper(("dBBE"))
// (0)
long count_upper(std::string s) {
| transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py | verbatim | }
int main() {
auto candidate = count_upper;
assert(candidate(("aBCdEf")) == (1));
assert(candidate(("abcdefg")) == (0));
assert(candidate(("dBBE")) == (0));
assert(candidate(("B")) == (0));
assert(candidate(("U")) == (1));
assert(candidate(("")) == (0));
assert(candidate(("EEEE")) == (2... | [
"\n}"
] |
HumanEval_99_closest_integer | cpp | #include<assert.h>
#include<bits/stdc++.h>
// Create a function that takes a value (string) representing a number
// and returns the closest integer to it. If the number is equidistant
// from two integers, round it away from zero.
// Examples
// >>> closest_integer(("10"))
// (10)
// >>> closest_integer(("15.3"))
// (... | transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py | verbatim | }
int main() {
auto candidate = closest_integer;
assert(candidate(("10")) == (10));
assert(candidate(("14.5")) == (15));
assert(candidate(("-15.5")) == (-16));
assert(candidate(("15.3")) == (15));
assert(candidate(("0")) == (0));
}
| [
"\n}"
] |
HumanEval_9_rolling_max | cpp | #include<assert.h>
#include<bits/stdc++.h>
// From a given list of integers, generate a list of rolling maximum element found until given moment
// in the sequence.
// >>> rolling_max((std::vector<long>({(long)1, (long)2, (long)3, (long)2, (long)3, (long)4, (long)2})))
// (std::vector<long>({(long)1, (long)2, (long)3, ... | transform | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py | verbatim | }
int main() {
auto candidate = rolling_max;
assert(candidate((std::vector<long>())) == (std::vector<long>()));
assert(candidate((std::vector<long>({(long)1, (long)2, (long)3, (long)4}))) == (std::vector<long>({(long)1, (long)2, (long)3, (long)4})));
assert(candidate((std::vector<long>({(long)4, (long)3... | [
"\n}"
] |
HumanEval_0_has_close_elements | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// Check if in given list of numbers, are any two numbers closer to each other than
// given threshold.
// >>> has_close_... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_0_has_close_elements.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(HasCloseElements((new List<float>(new float[]{(float)1.0f, (float)2.0f, (float)3.9f, (float)4.0f, (float)5.0f, (float)2.2f})), (0.3f)) == (true));
Debug.Assert(HasCloseElements((new List<float>(new float[]{(float)1.0f, (float)2.0f, (float)3.9f, (fl... | [
"\n }\n"
] |
HumanEval_100_make_a_pile | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// Given a positive integer n, you have to make a pile of n levels of stones.
// The first level has n stones.
// The num... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_100_make_a_pile.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(MakeAPile((3L)).Equals((new List<long>(new long[]{(long)3L, (long)5L, (long)7L}))));
Debug.Assert(MakeAPile((4L)).Equals((new List<long>(new long[]{(long)4L, (long)6L, (long)8L, (long)10L}))));
Debug.Assert(MakeAPile((5L)).Equals((new List<long... | [
"\n }\n"
] |
HumanEval_101_words_string | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// You will be given a string of words separated by commas or spaces. Your task is
// to split the string into words and retu... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_101_words_string.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(WordsString(("Hi, my name is John")).Equals((new List<string>(new string[]{(string)"Hi", (string)"my", (string)"name", (string)"is", (string)"John"}))));
Debug.Assert(WordsString(("One, two, three, four, five, six")).Equals((new List<string>(new st... | [
"\n }\n"
] |
HumanEval_102_choose_num | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// This function takes two positive numbers x and y and returns the
// biggest even integer number that is in the range [x, y... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_102_choose_num.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(ChooseNum((12L), (15L)) == (14L));
Debug.Assert(ChooseNum((13L), (12L)) == (-1L));
Debug.Assert(ChooseNum((33L), (12354L)) == (12354L));
Debug.Assert(ChooseNum((5234L), (5233L)) == (-1L));
Debug.Assert(ChooseNum((6L), (29L)) == (28L));
... | [
"\n }\n"
] |
HumanEval_104_unique_digits | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// Given a list of positive integers x. return a sorted list of all
// elements that hasn't any even digit.
// Note: Ret... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_104_unique_digits.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(UniqueDigits((new List<long>(new long[]{(long)15L, (long)33L, (long)1422L, (long)1L}))).Equals((new List<long>(new long[]{(long)1L, (long)15L, (long)33L}))));
Debug.Assert(UniqueDigits((new List<long>(new long[]{(long)152L, (long)323L, (long)1422L,... | [
"\n }\n"
] |
HumanEval_105_by_length | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// Given an array of integers, sort the integers that are between 1 and 9 inclusive,
// reverse the resulting array, and then... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_105_by_length.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(ByLength((new List<long>(new long[]{(long)2L, (long)1L, (long)1L, (long)4L, (long)5L, (long)8L, (long)2L, (long)3L}))).Equals((new List<string>(new string[]{(string)"Eight", (string)"Five", (string)"Four", (string)"Three", (string)"Two", (string)"Two",... | [
"\n }\n"
] |
HumanEval_106_f | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// Implement the function f that takes n as a parameter,
// and returns a list of size n, such that the value of the element ... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_106_f.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(F((5L)).Equals((new List<long>(new long[]{(long)1L, (long)2L, (long)6L, (long)24L, (long)15L}))));
Debug.Assert(F((7L)).Equals((new List<long>(new long[]{(long)1L, (long)2L, (long)6L, (long)24L, (long)15L, (long)720L, (long)28L}))));
Debug.Asse... | [
"\n }\n"
] |
HumanEval_107_even_odd_palindrome | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// Given a positive integer n, return a tuple that has the number of even and odd
// integer palindromes that fall within the... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_107_even_odd_palindrome.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(EvenOddPalindrome((123L)).Equals((Tuple.Create(8L, 13L))));
Debug.Assert(EvenOddPalindrome((12L)).Equals((Tuple.Create(4L, 6L))));
Debug.Assert(EvenOddPalindrome((3L)).Equals((Tuple.Create(1L, 2L))));
Debug.Assert(EvenOddPalindrome((63L)).E... | [
"\n }\n"
] |
HumanEval_108_count_nums | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// Write a function count_nums which takes an array of integers and returns
// the number of elements which has a sum of digi... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_108_count_nums.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(CountNums((new List<long>())) == (0L));
Debug.Assert(CountNums((new List<long>(new long[]{(long)-1L, (long)-2L, (long)0L}))) == (0L));
Debug.Assert(CountNums((new List<long>(new long[]{(long)1L, (long)1L, (long)2L, (long)-2L, (long)3L, (long)4L... | [
"\n }\n"
] |
HumanEval_109_move_one_ball | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The
// numbers in the array will be randomly ordered. You... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_109_move_one_ball.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(MoveOneBall((new List<long>(new long[]{(long)3L, (long)4L, (long)5L, (long)1L, (long)2L}))) == (true));
Debug.Assert(MoveOneBall((new List<long>(new long[]{(long)3L, (long)5L, (long)10L, (long)1L, (long)2L}))) == (true));
Debug.Assert(MoveOneBa... | [
"\n }\n"
] |
HumanEval_10_make_palindrome | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// Find the shortest palindrome that begins with a supplied string.
// Algorithm idea is simple:
// - Find the longest po... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_10_make_palindrome.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(MakePalindrome(("")).Equals(("")));
Debug.Assert(MakePalindrome(("x")).Equals(("x")));
Debug.Assert(MakePalindrome(("xyz")).Equals(("xyzyx")));
Debug.Assert(MakePalindrome(("xyx")).Equals(("xyx")));
Debug.Assert(MakePalindrome(("jerry")... | [
"\n }\n"
] |
HumanEval_110_exchange | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// In this problem, you will implement a function that takes two lists of numbers,
// and determines whether it is possible t... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_110_exchange.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(Exchange((new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L})), (new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))).Equals(("YES")));
Debug.Assert(Exchange((new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (l... | [
"\n }\n"
] |
HumanEval_111_histogram | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// Given a string representing a space separated lowercase letters, return a dictionary
// of the letter with the most repeti... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_111_histogram.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(Histogram(("a b b a")).Equals((new Dictionary<string,long>(){{"a", 2L}, {"b", 2L}})));
Debug.Assert(Histogram(("a b c a b")).Equals((new Dictionary<string,long>(){{"a", 2L}, {"b", 2L}})));
Debug.Assert(Histogram(("a b c d g")).Equals((new Dicti... | [
"\n }\n"
] |
HumanEval_112_reverse_delete | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// Task
// We are given two strings s and c, you have to deleted all the characters in s that are equal to any character in c... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_112_reverse_delete.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(ReverseDelete(("abcde"), ("ae")).Equals((Tuple.Create("bcd", false))));
Debug.Assert(ReverseDelete(("abcdef"), ("b")).Equals((Tuple.Create("acdef", false))));
Debug.Assert(ReverseDelete(("abcdedcba"), ("ab")).Equals((Tuple.Create("cdedc", true)... | [
"\n }\n"
] |
HumanEval_113_odd_count | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// Given a list of strings, where each string consists of only digits, return a list.
// Each element i of the output should ... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_113_odd_count.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(OddCount((new List<string>(new string[]{(string)"1234567"}))).Equals((new List<string>(new string[]{(string)"the number of odd elements 4n the str4ng 4 of the 4nput."}))));
Debug.Assert(OddCount((new List<string>(new string[]{(string)"3", (string)"... | [
"\n }\n"
] |
HumanEval_114_minSubArraySum | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// Given an array of integers nums, find the minimum sum of any non-empty sub-array
// of nums.
// Example
// minSubA... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_114_minSubArraySum.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(Minsubarraysum((new List<long>(new long[]{(long)2L, (long)3L, (long)4L, (long)1L, (long)2L, (long)4L}))) == (1L));
Debug.Assert(Minsubarraysum((new List<long>(new long[]{(long)-1L, (long)-2L, (long)-3L}))) == (-6L));
Debug.Assert(Minsubarraysum... | [
"\n }\n"
] |
HumanEval_115_max_fill | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// You are given a rectangular grid of wells. Each row represents a single well,
// and each 1 in a row represents a single u... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_115_max_fill.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(MaxFill((new List<List<long>>(new List<long>[]{(List<long>)new List<long>(new long[]{(long)0L, (long)0L, (long)1L, (long)0L}), (List<long>)new List<long>(new long[]{(long)0L, (long)1L, (long)0L, (long)0L}), (List<long>)new List<long>(new long[]{(long)1... | [
"\n }\n"
] |
HumanEval_116_sort_array | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// In this Kata, you have to sort an array of non-negative integers according to
// number of ones in their binary representa... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_116_sort_array.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(SortArray((new List<long>(new long[]{(long)1L, (long)5L, (long)2L, (long)3L, (long)4L}))).Equals((new List<long>(new long[]{(long)1L, (long)2L, (long)4L, (long)3L, (long)5L}))));
Debug.Assert(SortArray((new List<long>(new long[]{(long)-2L, (long)-3... | [
"\n }\n"
] |
HumanEval_117_select_words | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// Given a string s and a natural number n, you have been tasked to implement
// a function that returns a list of all words... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_117_select_words.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(SelectWords(("Mary had a little lamb"), (4L)).Equals((new List<string>(new string[]{(string)"little"}))));
Debug.Assert(SelectWords(("Mary had a little lamb"), (3L)).Equals((new List<string>(new string[]{(string)"Mary", (string)"lamb"}))));
Deb... | [
"\n }\n"
] |
HumanEval_118_get_closest_vowel | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// You are given a word. Your task is to find the closest vowel that stands between
// two consonants from the right side of... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_118_get_closest_vowel.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(GetClosestVowel(("yogurt")).Equals(("u")));
Debug.Assert(GetClosestVowel(("full")).Equals(("u")));
Debug.Assert(GetClosestVowel(("easy")).Equals(("")));
Debug.Assert(GetClosestVowel(("eAsy")).Equals(("")));
Debug.Assert(GetClosestVowel(... | [
"\n }\n"
] |
HumanEval_119_match_parens | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// You are given a list of two strings, both strings consist of open
// parentheses '(' or close parentheses ')' only.
//... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_119_match_parens.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(MatchParens((new List<string>(new string[]{(string)"()(", (string)")"}))).Equals(("Yes")));
Debug.Assert(MatchParens((new List<string>(new string[]{(string)")", (string)")"}))).Equals(("No")));
Debug.Assert(MatchParens((new List<string>(new str... | [
"\n }\n"
] |
HumanEval_11_string_xor | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// Input are two strings a and b consisting only of 1s and 0s.
// Perform binary XOR on these inputs and return result also a... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_11_string_xor.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(StringXor(("111000"), ("101010")).Equals(("010010")));
Debug.Assert(StringXor(("1"), ("1")).Equals(("0")));
Debug.Assert(StringXor(("0101"), ("0000")).Equals(("0101")));
}
}
| [
"\n }\n"
] |
HumanEval_120_maximum | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// Given an array arr of integers and a positive integer k, return a sorted list
// of length k with the maximum k numbers i... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_120_maximum.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(Maximum((new List<long>(new long[]{(long)-3L, (long)-4L, (long)5L})), (3L)).Equals((new List<long>(new long[]{(long)-4L, (long)-3L, (long)5L}))));
Debug.Assert(Maximum((new List<long>(new long[]{(long)4L, (long)-4L, (long)4L})), (2L)).Equals((new L... | [
"\n }\n"
] |
HumanEval_121_solution | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.
// Examples
... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_121_solution.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(Solution((new List<long>(new long[]{(long)5L, (long)8L, (long)7L, (long)1L}))) == (12L));
Debug.Assert(Solution((new List<long>(new long[]{(long)3L, (long)3L, (long)3L, (long)3L, (long)3L}))) == (9L));
Debug.Assert(Solution((new List<long>(new ... | [
"\n }\n"
] |
HumanEval_122_add_elements | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// Given a non-empty array of integers arr and an integer k, return
// the sum of the elements with at most two digits from t... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_122_add_elements.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(AddElements((new List<long>(new long[]{(long)1L, (long)-2L, (long)-3L, (long)41L, (long)57L, (long)76L, (long)87L, (long)88L, (long)99L})), (3L)) == (-4L));
Debug.Assert(AddElements((new List<long>(new long[]{(long)111L, (long)121L, (long)3L, (long... | [
"\n }\n"
] |
HumanEval_123_get_odd_collatz | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.
// The Collatz conjecture i... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_123_get_odd_collatz.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(GetOddCollatz((14L)).Equals((new List<long>(new long[]{(long)1L, (long)5L, (long)7L, (long)11L, (long)13L, (long)17L}))));
Debug.Assert(GetOddCollatz((5L)).Equals((new List<long>(new long[]{(long)1L, (long)5L}))));
Debug.Assert(GetOddCollatz((1... | [
"\n }\n"
] |
HumanEval_124_valid_date | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// You have to write a function which validates a given date string and
// returns True if the date is valid otherwise False.... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_124_valid_date.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(ValidDate(("03-11-2000")) == (true));
Debug.Assert(ValidDate(("15-01-2012")) == (false));
Debug.Assert(ValidDate(("04-0-2040")) == (false));
Debug.Assert(ValidDate(("06-04-2020")) == (true));
Debug.Assert(ValidDate(("01-01-2007")) == (t... | [
"\n }\n"
] |
HumanEval_126_is_sorted | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// Given a list of numbers, return whether or not they are sorted
// in ascending order. If list has more than 1 duplicate of... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_126_is_sorted.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(IsSorted((new List<long>(new long[]{(long)5L}))) == (true));
Debug.Assert(IsSorted((new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L}))) == (true));
Debug.Assert(IsSorted((new List<long>(new long[]{(long)1L, (long)3L, ... | [
"\n }\n"
] |
HumanEval_127_intersection | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// You are given two intervals,
// where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).
... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_127_intersection.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(Intersection((Tuple.Create(1L, 2L)), (Tuple.Create(2L, 3L))).Equals(("NO")));
Debug.Assert(Intersection((Tuple.Create(-1L, 1L)), (Tuple.Create(0L, 4L))).Equals(("NO")));
Debug.Assert(Intersection((Tuple.Create(-3L, -1L)), (Tuple.Create(-5L, 5L)... | [
"\n }\n"
] |
HumanEval_128_prod_signs | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// You are given an array arr of integers and you need to return
// sum of magnitudes of integers multiplied by product of al... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_128_prod_signs.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(ProdSigns((new List<long>(new long[]{(long)1L, (long)2L, (long)2L, (long)-4L}))).Equals(-9L));
Debug.Assert(ProdSigns((new List<long>(new long[]{(long)0L, (long)1L}))).Equals(0L));
Debug.Assert(ProdSigns((new List<long>(new long[]{(long)1L, (lo... | [
"\n }\n"
] |
HumanEval_129_minPath | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// Given a grid with N rows and N columns (N >= 2) and a positive integer k,
// each cell of the grid contains a value. Ever... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_129_minPath.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(Minpath((new List<List<long>>(new List<long>[]{(List<long>)new List<long>(new long[]{(long)1L, (long)2L, (long)3L}), (List<long>)new List<long>(new long[]{(long)4L, (long)5L, (long)6L}), (List<long>)new List<long>(new long[]{(long)7L, (long)8L, (long)9... | [
"\n }\n"
] |
HumanEval_12_longest | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// Out of list of strings, return the longest one. Return the first one in case of multiple
// strings of the same length. Re... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_12_longest.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(Longest((new List<string>())).Equals(null));
Debug.Assert(Longest((new List<string>(new string[]{(string)"x", (string)"y", (string)"z"}))).Equals(("x")));
Debug.Assert(Longest((new List<string>(new string[]{(string)"x", (string)"yyy", (string)"... | [
"\n }\n"
] |
HumanEval_130_tri | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in
// the last couple centuries. However, what... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_130_tri.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(Tri((3L)).Equals((new List<long>(new long[]{(long)1L, (long)3L, (long)2L, (long)8L}))));
Debug.Assert(Tri((4L)).Equals((new List<long>(new long[]{(long)1L, (long)3L, (long)2L, (long)8L, (long)3L}))));
Debug.Assert(Tri((5L)).Equals((new List<lon... | [
"\n }\n"
] |
HumanEval_131_digits | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// Given a positive integer n, return the product of the odd digits.
// Return 0 if all digits are even.
// For example:
... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_131_digits.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(Digits((5L)) == (5L));
Debug.Assert(Digits((54L)) == (5L));
Debug.Assert(Digits((120L)) == (1L));
Debug.Assert(Digits((5014L)) == (5L));
Debug.Assert(Digits((98765L)) == (315L));
Debug.Assert(Digits((5576543L)) == (2625L));
Debu... | [
"\n }\n"
] |
HumanEval_132_is_nested | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// Create a function that takes a string as input which contains only square brackets.
// The function should return True if ... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_132_is_nested.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(IsNested(("[[]]")) == (true));
Debug.Assert(IsNested(("[]]]]]]][[[[[]")) == (false));
Debug.Assert(IsNested(("[][]")) == (false));
Debug.Assert(IsNested(("[]")) == (false));
Debug.Assert(IsNested(("[[[[]]]]")) == (true));
Debug.Asse... | [
"\n }\n"
] |
HumanEval_133_sum_squares | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// You are given a list of numbers.
// You need to return the sum of squared numbers in the given list,
// round each ele... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_133_sum_squares.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(SumSquares((new List<float>(new float[]{(float)1.0f, (float)2.0f, (float)3.0f}))) == (14L));
Debug.Assert(SumSquares((new List<float>(new float[]{(float)1.0f, (float)2.0f, (float)3.0f}))) == (14L));
Debug.Assert(SumSquares((new List<float>(new ... | [
"\n }\n"
] |
HumanEval_134_check_if_last_char_is_a_letter | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// Create a function that returns True if the last character
// of a given string is an alphabetical character and is not
... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_134_check_if_last_char_is_a_letter.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(CheckIfLastCharIsALetter(("apple")) == (false));
Debug.Assert(CheckIfLastCharIsALetter(("apple pi e")) == (true));
Debug.Assert(CheckIfLastCharIsALetter(("eeeee")) == (false));
Debug.Assert(CheckIfLastCharIsALetter(("A")) == (true));
De... | [
"\n }\n"
] |
HumanEval_135_can_arrange | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// Create a function which returns the largest index of an element which
// is not greater than or equal to the element immed... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_135_can_arrange.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(CanArrange((new List<long>(new long[]{(long)1L, (long)2L, (long)4L, (long)3L, (long)5L}))) == (3L));
Debug.Assert(CanArrange((new List<long>(new long[]{(long)1L, (long)2L, (long)4L, (long)5L}))) == (-1L));
Debug.Assert(CanArrange((new List<long... | [
"\n }\n"
] |
HumanEval_136_largest_smallest_integers | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// Create a function that returns a tuple (a, b), where 'a' is
// the largest of negative integers, and 'b' is the smallest
... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_136_largest_smallest_integers.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(LargestSmallestIntegers((new List<long>(new long[]{(long)2L, (long)4L, (long)1L, (long)3L, (long)5L, (long)7L}))).Equals(Tuple.Create((Nullable<long>)null, 1L)));
Debug.Assert(LargestSmallestIntegers((new List<long>(new long[]{(long)2L, (long)4L, (... | [
"\n }\n"
] |
HumanEval_138_is_equal_to_sum_even | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers
// Example
// is_equa... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_138_is_equal_to_sum_even.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(IsEqualToSumEven((4L)) == (false));
Debug.Assert(IsEqualToSumEven((6L)) == (false));
Debug.Assert(IsEqualToSumEven((8L)) == (true));
Debug.Assert(IsEqualToSumEven((10L)) == (true));
Debug.Assert(IsEqualToSumEven((11L)) == (false));
... | [
"\n }\n"
] |
HumanEval_139_special_factorial | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// The Brazilian factorial is defined as:
// brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!
// where n > 0
... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_139_special_factorial.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(SpecialFactorial((4L)) == (288L));
Debug.Assert(SpecialFactorial((5L)) == (34560L));
Debug.Assert(SpecialFactorial((7L)) == (125411328000L));
Debug.Assert(SpecialFactorial((1L)) == (1L));
}
}
| [
"\n }\n"
] |
HumanEval_13_greatest_common_divisor | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// Return a greatest common divisor of two integers a and b
// >>> greatest_common_divisor(3, 5)
// 1
// >>> greatest... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_13_greatest_common_divisor.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(GreatestCommonDivisor((3L), (7L)) == (1L));
Debug.Assert(GreatestCommonDivisor((10L), (15L)) == (5L));
Debug.Assert(GreatestCommonDivisor((49L), (14L)) == (7L));
Debug.Assert(GreatestCommonDivisor((144L), (60L)) == (12L));
}
}
| [
"\n }\n"
] |
HumanEval_140_fix_spaces | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// Given a string text, replace all spaces in it with underscores,
// and if a string has more than 2 consecutive spaces,
... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_140_fix_spaces.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(FixSpaces(("Example")).Equals(("Example")));
Debug.Assert(FixSpaces(("Mudasir Hanif ")).Equals(("Mudasir_Hanif_")));
Debug.Assert(FixSpaces(("Yellow Yellow Dirty Fellow")).Equals(("Yellow_Yellow__Dirty__Fellow")));
Debug.Assert(FixSpaces(... | [
"\n }\n"
] |
HumanEval_141_file_name_check | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// Create a function which takes a string representing a file's name, and returns
// 'Yes' if the the file's name is valid, a... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_141_file_name_check.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(FileNameCheck(("example.txt")).Equals(("Yes")));
Debug.Assert(FileNameCheck(("1example.dll")).Equals(("No")));
Debug.Assert(FileNameCheck(("s1sdf3.asd")).Equals(("No")));
Debug.Assert(FileNameCheck(("K.dll")).Equals(("Yes")));
Debug.Ass... | [
"\n }\n"
] |
HumanEval_142_sum_squares | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// "
// This function will take a list of integers. For all entries in the list, the function shall square the integer entry ... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_142_sum_squares.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(SumSquares((new List<long>(new long[]{(long)1L, (long)2L, (long)3L}))) == (6L));
Debug.Assert(SumSquares((new List<long>(new long[]{(long)1L, (long)4L, (long)9L}))) == (14L));
Debug.Assert(SumSquares((new List<long>())) == (0L));
Debug.Asse... | [
"\n }\n"
] |
HumanEval_143_words_in_sentence | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// You are given a string representing a sentence,
// the sentence contains some words separated by a space,
// and you h... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_143_words_in_sentence.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(WordsInSentence(("This is a test")).Equals(("is")));
Debug.Assert(WordsInSentence(("lets go for swimming")).Equals(("go for")));
Debug.Assert(WordsInSentence(("there is no place available here")).Equals(("there is no place")));
Debug.Assert... | [
"\n }\n"
] |
HumanEval_144_simplify | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// Your task is to implement a function that will simplify the expression
// x * n. The function returns True if x * n evalua... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_144_simplify.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(Simplify(("1/5"), ("5/1")) == (true));
Debug.Assert(Simplify(("1/6"), ("2/1")) == (false));
Debug.Assert(Simplify(("5/1"), ("3/1")) == (true));
Debug.Assert(Simplify(("7/10"), ("10/2")) == (false));
Debug.Assert(Simplify(("2/10"), ("50/... | [
"\n }\n"
] |
HumanEval_145_order_by_points | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// Write a function which sorts the given list of integers
// in ascending order according to the sum of their digits.
//... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_145_order_by_points.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(OrderByPoints((new List<long>(new long[]{(long)1L, (long)11L, (long)-1L, (long)-11L, (long)-12L}))).Equals((new List<long>(new long[]{(long)-1L, (long)-11L, (long)1L, (long)-12L, (long)11L}))));
Debug.Assert(OrderByPoints((new List<long>(new long[]... | [
"\n }\n"
] |
HumanEval_146_specialFilter | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// Write a function that takes an array of numbers as input and returns
// the number of elements in the array that are grea... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_146_specialFilter.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(Specialfilter((new List<long>(new long[]{(long)5L, (long)-2L, (long)1L, (long)-5L}))) == (0L));
Debug.Assert(Specialfilter((new List<long>(new long[]{(long)15L, (long)-73L, (long)14L, (long)-15L}))) == (1L));
Debug.Assert(Specialfilter((new Lis... | [
"\n }\n"
] |
HumanEval_147_get_max_triples | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// You are given a positive integer n. You have to create an integer array a of length n.
// For each i (1 ≤ i ≤ n), the valu... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_147_get_max_triples.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(GetMaxTriples((5L)) == (1L));
Debug.Assert(GetMaxTriples((6L)) == (4L));
Debug.Assert(GetMaxTriples((10L)) == (36L));
Debug.Assert(GetMaxTriples((100L)) == (53361L));
}
}
| [
"\n }\n"
] |
HumanEval_148_bf | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// There are eight planets in our solar system: the closerst to the Sun
// is Mercury, the next one is Venus, then Earth, Ma... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_148_bf.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(Bf(("Jupiter"), ("Neptune")).Equals((new List<string>(new string[]{(string)"Saturn", (string)"Uranus"}))));
Debug.Assert(Bf(("Earth"), ("Mercury")).Equals((new List<string>(new string[]{(string)"Venus"}))));
Debug.Assert(Bf(("Mercury"), ("Uranu... | [
"\n }\n"
] |
HumanEval_149_sorted_list_sum | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// Write a function that accepts a list of strings as a parameter,
// deletes the strings that have odd lengths from it,
... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_149_sorted_list_sum.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(SortedListSum((new List<string>(new string[]{(string)"aa", (string)"a", (string)"aaa"}))).Equals((new List<string>(new string[]{(string)"aa"}))));
Debug.Assert(SortedListSum((new List<string>(new string[]{(string)"school", (string)"AI", (string)"as... | [
"\n }\n"
] |
HumanEval_14_all_prefixes | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// Return list of all prefixes from shortest to longest of the input string
// >>> all_prefixes('abc')
// ['a', 'ab', 'ab... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_14_all_prefixes.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(AllPrefixes(("")).Equals((new List<string>())));
Debug.Assert(AllPrefixes(("asdfgh")).Equals((new List<string>(new string[]{(string)"a", (string)"as", (string)"asd", (string)"asdf", (string)"asdfg", (string)"asdfgh"}))));
Debug.Assert(AllPrefix... | [
"\n }\n"
] |
HumanEval_150_x_or_y | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// A simple program which should return the value of x if n is
// a prime number and should return the value of y otherwise.... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_150_x_or_y.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(XOrY((7L), (34L), (12L)) == (34L));
Debug.Assert(XOrY((15L), (8L), (5L)) == (5L));
Debug.Assert(XOrY((3L), (33L), (5212L)) == (33L));
Debug.Assert(XOrY((1259L), (3L), (52L)) == (3L));
Debug.Assert(XOrY((7919L), (-1L), (12L)) == (-1L));
... | [
"\n }\n"
] |
HumanEval_151_double_the_difference | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// Given a list of numbers, return the sum of squares of the numbers
// in the list that are odd. Ignore numbers that are neg... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_151_double_the_difference.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(DoubleTheDifference((new List<float>())) == (0L));
Debug.Assert(DoubleTheDifference((new List<float>(new float[]{(float)5.0f, (float)4.0f}))) == (25L));
Debug.Assert(DoubleTheDifference((new List<float>(new float[]{(float)0.1f, (float)0.2f, (fl... | [
"\n }\n"
] |
HumanEval_152_compare | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// I think we all remember that feeling when the result of some long-awaited
// event is finally known. The feelings and thou... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_152_compare.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(Compare((new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)1L})), (new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)2L, (long)-2L}))).Equals((new List<long>(new long[]{(long)0L, (long)0L, (long)0L,... | [
"\n }\n"
] |
HumanEval_153_Strongest_Extension | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// You will be given the name of a class (a string) and a list of extensions.
// The extensions are to be used to load additi... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_153_Strongest_Extension.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(StrongestExtension(("Watashi"), (new List<string>(new string[]{(string)"tEN", (string)"niNE", (string)"eIGHt8OKe"}))).Equals(("Watashi.eIGHt8OKe")));
Debug.Assert(StrongestExtension(("Boku123"), (new List<string>(new string[]{(string)"nani", (strin... | [
"\n }\n"
] |
HumanEval_154_cycpattern_check | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word
... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_154_cycpattern_check.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(CycpatternCheck(("xyzw"), ("xyw")) == (false));
Debug.Assert(CycpatternCheck(("yello"), ("ell")) == (true));
Debug.Assert(CycpatternCheck(("whattup"), ("ptut")) == (false));
Debug.Assert(CycpatternCheck(("efef"), ("fee")) == (true));
De... | [
"\n }\n"
] |
HumanEval_155_even_odd_count | cs | using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem {
// Given an integer. return a tuple that has the number of even and odd digits respectively.
// Example:
// even_odd_coun... | keep | /home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_155_even_odd_count.py | verbatim | }
public static void Main(string[] args) {
Debug.Assert(EvenOddCount((7L)).Equals((Tuple.Create(0L, 1L))));
Debug.Assert(EvenOddCount((-78L)).Equals((Tuple.Create(1L, 1L))));
Debug.Assert(EvenOddCount((3452L)).Equals((Tuple.Create(2L, 2L))));
Debug.Assert(EvenOddCount((346211L)).Equals((Tuple.Cr... | [
"\n }\n"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.