stop_tokens
listlengths
1
1
prompt
stringlengths
98
766
prompt_terminology
stringclasses
1 value
doctests
stringclasses
1 value
name
stringlengths
15
44
tests
stringlengths
326
1.94k
original
stringlengths
130
159
language
stringclasses
1 value
[ "\n}" ]
/// 正の整数xのリストが与えられたとき、偶数桁の要素を持たない全ての /// 要素をソートしたリストを返す。 /// 注意: 返されるリストは昇順にソートされていなければならない。 /// 例えば: /// >>> unique_digits(x: [15, 33, 1422, 1]) /// [1, 15, 33] /// >>> unique_digits(x: [152, 323, 1422, 10]) /// [] as [Int] func unique_digits(x: [Int]) -> [Int] {
reworded
transform
HumanEval_104_unique_digits
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(unique_digits(x: [15, 33, 1422, 1]) == [1, 15, 33]) assert(...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py
swift
[ "\n}" ]
/// 整数の配列が与えられたとき、1から9までの整数をソートし、 /// 得られた配列を逆順にし、各桁を以下の数字に相当する名前に置き換える。 /// "One"、"Two"、"Three"、"Four"、"Five"、"Six"、"Seven"、"Eight"、"Nine " /// 例えば: ///>>> by_length(arr: [2, 1, 1, 4, 5, 8, 2, 3]) /// ["Eight", "Five", "Four", "Three", "Two", "Two", "One", "One"] /// もし空配列なら、空配列を返す: /// >>> by_length(arr: [] as [Int]...
reworded
transform
HumanEval_105_by_length
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(by_length(arr: [2, 1, 1, 4, 5, 8, 2, 3]) == ["Eight", "Five...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py
swift
[ "\n}" ]
/// iは1から始まる。iの階乗は1からiまでの数の掛け算(1 * 2 * ... * i)である。 /// 例: /// >>> f(n: 5) /// [1, 2, 6, 24, 15] func f(n: Int) -> [Int] {
reworded
transform
HumanEval_106_f
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(f(n: 5) == [1, 2, 6, 24, 15]) assert(f(n: 7) == [1, 2, 6, 2...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py
swift
[ "\n}" ]
/// 与えられた正の整数 nに対して、範囲 1 から n まで(両端を含む)に存在する /// 偶数の回文数(integer palindrome)と奇数の回文数の個数をタプル形式で返す。 /// 例 1: /// >>> even_odd_palindrome(n: 3) /// (1, 2) /// 解説: /// 回文数は1、2、3であり、そのうち1つは偶数、2つは奇数である。 /// 例 2: /// >>> even_odd_palindrome(n: 12) /// (4, 6) /// 解説: /// 回文数は、1、2、3、4、5、6、7、8、9、11であり、そのうち4つは偶数、6つは奇数である。 ///...
reworded
transform
HumanEval_107_even_odd_palindrome
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(even_odd_palindrome(n: 123) == (8, 13)) assert(even_odd_pal...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py
swift
[ "\n}" ]
/// count_nums 関数は、整数の配列を引数として受け取り、その配列内の各整数の各桁の合計が /// >0 となるような整数の個数を返す。負の数に関しては、最初の桁(符号付き桁)は負となる。 /// たとえば、−123 の符号付き桁は −1, 2, 3 である。 /// >>> count_nums(arr: [] as [Int]) /// 0 /// >>> count_nums(arr: [-1, 11, -11]) /// 1 /// >>> count_nums(arr: [1, 1, 2]) /// 3 func count_nums(arr: [Int]) -> Int {
reworded
transform
HumanEval_108_count_nums
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(count_nums(arr: [] as [Int]) == 0) assert(count_nums(arr: [...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py
swift
[ "\n}" ]
/// N個の整数arr[1], arr[2], ..., arr[N]なる配列 'arr' があります。 /// この配列の数字はランダムな順番に並んでいます。あなたの課題は、以下の操作を何度でも行うことで、 /// 配列を非減少の順番にソートできるかどうかを判断することです。 /// 操作として許されているのは「右シフト」です。 /// 一回の「右シフト」操作とは、配列のすべての要素を右方向に一つずつずらすことを意味します。 /// 配列の最後の要素は配列の先頭、すなわち0番目のインデックスに移動します。 /// 上記の操作を行ってソートされた配列を得られる場合は true を、そうでない場合は false を返してください。...
reworded
transform
HumanEval_109_move_one_ball
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(move_one_ball(arr: [3, 4, 5, 1, 2]) == true) assert(move_on...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py
swift
[ "\n}" ]
/// この問題では、2つの数のリストを受け取り、lst1を偶数のみのリストに /// するために、それらの間で要素の交換を行うことが可能かどうかを判断す /// る関数を実装する。 /// lst1とlst2の間で交換される要素の数に制限はない。 /// lst1とlst2の間で要素の交換を行い、lst1の要素をすべて偶数にすることが /// 可能であれば、"YES "を返す。 /// そうでなければ "NO "を返す。 /// 例えば: /// >>> exchange(lst1: [1, 2, 3, 4], lst2: [1, 2, 3, 4]) /// "YES" /// >>> exchange(lst1: [1, 2,...
reworded
transform
HumanEval_110_exchange
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(exchange(lst1: [1, 2, 3, 4], lst2: [1, 2, 3, 4]) == "YES") ...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py
swift
[ "\n}" ]
/// 空白で区切られた小文字を表す文字列が与えられる。最も出現回数が多い文字と /// 対応するカウントの辞書を返す。 /// 複数の文字が同じ出現回数を持つ場合、それらすべてを返す。 /// 例: /// >>> histogram(test: "a b c") /// ["a" : 1, "b" : 1, "c" : 1] /// >>> histogram(test: "a b b a") /// ["a" : 2, "b" : 2] /// >>> histogram(test: "a b c a b") /// ["a" : 2, "b" : 2] /// >>> histogram(test: "b b b b a"...
reworded
transform
HumanEval_111_histogram
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(histogram(test: "a b b a") == ["a" : 2, "b" : 2]) assert(hi...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py
swift
[ "\n}" ]
/// 課題 /// sとcの2つの文字列が与えられる。sに含まれる文字のうち、cに含まれる文字と /// 等しいものをすべて削除し、その結果の文字列が回文かどうかをチェックする。 /// 文字列は、後ろから読んでも前から読んでも同じであれば回文と呼ばれる。 /// 結果文字列とチェックのためのtrue/falseを含むタプルを返す必要がある。 /// 例 /// >>> reverse_delete(s: "abcde", c: "ae") /// ("bcd", false) /// >>> reverse_delete(s: "abcdef", c: "b") /// ("acdef", false) /// >>> rev...
reworded
transform
HumanEval_112_reverse_delete
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(reverse_delete(s: "abcde", c: "ae") == ("bcd", false)) asse...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py
swift
[ "\n}" ]
/// 数字のみで構成された文字列のリストを引数として受け取り、新しいリストを返します。 /// 出力される新しいリストの各要素は、"the number of odd elements in the string i of the /// input."となりますが、この文字列内のすべての 'i' は、入力リストのi番目の文字列に含ま /// る奇数の数に置き換えられます。 /// >>> odd_count(lst: ["1234567"]) /// ["the number of odd elements 4n the str4ng 4 of the 4nput."] /// >>> odd_count(lst: ["3"...
reworded
transform
HumanEval_113_odd_count
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(odd_count(lst: ["1234567"]) == ["the number of odd elements...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py
swift
[ "\n}" ]
/// 整数の配列 nums が与えられたとき、nums の空でない部分配列の最小和を求めよ。 /// 例: /// >>> minSubArraySum(nums: [2, 3, 4, 1, 2, 4]) /// 1 /// >>> minSubArraySum(nums: [-1, -2, -3]) /// -6 func minSubArraySum(nums: [Int]) -> Int {
reworded
transform
HumanEval_114_minSubArraySum
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(minSubArraySum(nums: [2, 3, 4, 1, 2, 4]) == 1) assert(minSu...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py
swift
[ "\n}" ]
/// 長方形のグリッド状(grid)の井戸が与えられる。各行が1つの井戸を表し、 /// 行の1が1単位の水を表す。 /// 各井戸には,そこから水を汲み上げるのに使える対応するバケツがあり, /// すべてのバケツ容量(capacity)は同じである. /// あなたの仕事は,バケツを使って井戸を空にすることである. /// バケツを降ろす回数を出力せよ. /// 例 1: /// >>> max_fill(grid: [[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], capacity: 1) /// 6 /// 例 2: /// >>> max_fill(grid: [[0, 0, 1,...
reworded
transform
HumanEval_115_max_fill
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(max_fill(grid: [[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], ...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py
swift
[ "\n}" ]
/// この問題では、非負整数の配列を2進数表現における"1"の個数を昇順でソートする。 /// "1"の個数が同じ場合は,10進数に基づいてソートする。 /// 次のように実装する: /// >>> sort_array(arr: [1, 5, 2, 3, 4]) /// [1, 2, 3, 4, 5] /// >>> sort_array(arr: [-2, -3, -4, -5, -6]) /// [-6, -5, -4, -3, -2] /// >>> sort_array(arr: [1, 0, 2, 3, 4]) /// [0, 1, 2, 3, 4] func sort_array(arr: [Int]) -> [I...
reworded
transform
HumanEval_116_sort_array
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(sort_array(arr: [1, 5, 2, 3, 4]) == [1, 2, 4, 3, 5]) assert...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py
swift
[ "\n}" ]
/// ある文字列sと自然数nが与えらる。あなたに課せられたタスクは、文字列s /// の中から、ちょうどn個の子音を含むすべての単語のリストを現れる順に返す /// 関数を実装することである。 /// 注意:入力文字列には英文字と空白しか含まれないと仮定してもよい。 /// 例: /// >>> select_words(s: "Mary had a little lamb", n: 4) /// ["little"] /// >>> select_words(s: "Mary had a little lamb", n: 3) /// ["Mary", "lamb"] /// >>> select_words(s: "simp...
reworded
transform
HumanEval_117_select_words
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(select_words(s: "Mary had a little lamb", n: 4) == ["little...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py
swift
[ "\n}" ]
/// 単語が与えられる。あなたの仕事は、単語の右側から2つの子音(大文字と /// 小文字を区別)の間に立っている最も近い母音を見つけることである。 /// 最初と最後の母音はカウントされない。上記の条件を満たす母音が見つから /// なかった場合は、空の文字列を返せ。 /// 指定された文字列は英字のみを含むとみなしてよい。 /// 例: /// >>> get_closest_vowel(word: "yogurt") /// "u" /// >>> get_closest_vowel(word: "FULL") /// "U" /// >>> get_closest_vowel(word: "quick") /// "" ...
reworded
transform
HumanEval_118_get_closest_vowel
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(get_closest_vowel(word: "yogurt") == "u") assert(get_closes...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py
swift
[ "\n}" ]
/// 2つの文字列からなるリストが与えられます。両方の文字列は開き括弧 '(' または /// 閉じ括弧 ')' のみで構成されています。 /// あなたの仕事は、2つの文字列を何らかの順序で結合して、「良い」文字列にすることが /// 可能かどうかを確認することです。 /// 文字列Sが「良い」とは、文字列内のすべての括弧がバランスしている場合に限ります。 /// 例えば、文字列 '(())()' は良いですが、文字列 '())' は良くありません。 /// 良い文字列を作る方法がある場合は 'Yes' を返し、そうでない場合は 'No' を返してください。 /// 例 /// >>> match_parens(lst: ["...
reworded
transform
HumanEval_119_match_parens
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(match_parens(lst: ["()(", ")"]) == "Yes") assert(match_pare...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py
swift
[ "\n}" ]
/// 整数の配列 arr と正の整数 k が与えられる。arr に含まれる大きい方から k 個の数を含む /// 長さ k のソート済みリストを返す。 /// 例 1: /// >>> maximum(arr: [-3, -4, 5], k: 3) /// [-4, -3, 5] /// 例 2: /// >>> maximum(arr: [4, -4, 4], k: 2) /// [4, 4] /// 例 3: /// >>> maximum(arr: [-3, 2, 1, 2, -1, -2, 1], k: 1) /// [2] /// ノート: /// 1. 配列の長さは[1, 1000]の範囲とする。 /// 2. 配列...
reworded
transform
HumanEval_120_maximum
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(maximum(arr: [-3, -4, 5], k: 3) == [-4, -3, 5]) assert(maxi...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py
swift
[ "\n}" ]
/// 整数の空でないリストが与えられた時、偶数の位置にある奇数の要素の合計を返す。 /// 例 /// >>> solution(lst: [5, 8, 7, 1]) /// 12 /// >>> solution(lst: [3, 3, 3, 3, 3]) /// 9 /// >>> solution(lst: [30, 13, 24, 321]) /// 0 func solution(lst: [Int]) -> Int {
reworded
transform
HumanEval_121_solution
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(solution(lst: [5, 8, 7, 1]) == 12) assert(solution(lst: [3,...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py
swift
[ "\n}" ]
/// 整数の空でない配列 arr と整数 k が与えられたとき、 /// arr の最初の k 個の要素から高々 2 桁までの要素の和を返す。 /// 例: /// >>> add_elements(arr: [111, 21, 3, 4000, 5, 6, 7, 8, 9], k: 4) /// 24 /// # 21 + 3 の話 /// 制約: /// 1. 1 <= len(arr) <= 100 /// 2. 1 <= k <= len(arr) func add_elements(arr: [Int], k: Int) -> Int {
reworded
transform
HumanEval_122_add_elements
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(add_elements(arr: [1, -2, -3, 41, 57, 76, 87, 88, 99], k: 3...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py
swift
[ "\n}" ]
/// 正の整数nが与えられたとき、コラッツ数列の奇数を持つソートされたリストを返す。 /// コラッツ予想とは数学の予想で、次のように定義される数列に関するものである: /// 任意の正の整数nから始め、各項は前の項から次のように求められる。 /// 前の項が偶数なら、次の項は前の項の2分の1である。前の項が奇数の場合、次の項は前の項の3倍+1である。 /// 予想では、nがどのような値であっても、数列は必ず1に達する。 /// 注: /// 1. Collatz(1)は[1]である。 /// 2. 返されるリストは昇順にソートされている。 /// 例えば: /// get_odd_collatz(5) は [1, 5]を返...
reworded
transform
HumanEval_123_get_odd_collatz
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(get_odd_collatz(n: 14) == [1, 5, 7, 11, 13, 17]) assert(get...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py
swift
[ "\n}" ]
/// 与えられた日付文字列を検証し、その日付が有効であればtrueを、そうでなければfalseを返す関数を書く必要がある。 /// 日付が有効であるのは、以下のルールがすべて満たされている場合である: /// 1. 日付文字列が空でない。 /// 2. 日数が、月1,3,5,7,8,10,12の場合、1日以上31日以下である。また、月4,6,9,11については、日数が1以上30日以下である。また、月2については、日数が1以上29以下であること。 /// 3. 月は1未満または12以上であってはならない。 /// 4. 日付はmm-dd-yyyyの形式でなければならない。 /// >>> valid_date(date: "03-...
reworded
transform
HumanEval_124_valid_date
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(valid_date(date: "03-11-2000") == true) assert(valid_date(d...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py
swift
[ "\n}" ]
extension Int: Error {} /// 単語の文字列が与えられた場合、空白で分割された単語のリストを返す。 /// テキスト中に空白が存在しない場合は、カンマ ',' で分割する必要がある。カンマが存在しない場合は、 /// アルファベットの奇数順の小文字の数を返す必要がある。ord('a') = 0, ord('b') = 1, ... ord('z') = 25 /// 例 /// >>> split_words(txt: "Hello world!") /// .success(["Hello", "world!"]) /// >>> split_words(txt: "Hello,worl...
reworded
transform
HumanEval_125_split_words
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(split_words(txt: "Hello world!") == .success(["Hello", "wor...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py
swift
[ "\n}" ]
/// 数字のリストが与えられたとき、昇順に整列されているかどうかを返す。 /// リストに同じ数の重複が1つ以上ある場合は、falseを返す。 /// 負の数はなく、整数のみであると仮定する。 /// 例 /// >>> is_sorted(lst: [5]) /// true /// >>> is_sorted(lst: [1, 2, 3, 4, 5]) /// true /// >>> is_sorted(lst: [1, 3, 2, 4, 5]) /// false /// >>> is_sorted(lst: [1, 2, 3, 4, 5, 6]) /// true /// >>> is_sorted(lst: [1, ...
reworded
transform
HumanEval_126_is_sorted
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(is_sorted(lst: [5]) == true) assert(is_sorted(lst: [1, 2, 3...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py
swift
[ "\n}" ]
/// 2つの区間が与えられます。 /// それぞれの区間は整数のペアで示されます。例えば、区間 = (start, end ) = (1, 2) です。 /// 与えられた区間は閉区間であり、start と end の両端が含まれます。 /// 各区間について、start は end 以下であると仮定します。 /// あなたの仕事は、これら2つの区間の交差部分の長さが素数であるかどうかを判断することです。 /// 例えば、区間 (1, 3) と (2, 4) の交差部分は (2, 3) で、その長さは1ですが、これは素数ではありません。 /// 交差部分の長さが素数であれば "YES" を返し、そうでなければ "NO...
reworded
transform
HumanEval_127_intersection
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(intersection(interval1: (1, 2), interval2: (2, 3)) == "NO")...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py
swift
[ "\n}" ]
/// 整数の配列 arr が与えられます。この配列に含まれる各数値の絶対値の合計と、 /// 各数値の符号(プラスは1、マイナスは-1、ゼロは0)の積を掛け合わせた値を /// 返してください。 /// 注意:配列`arr`が空の場合は`nil`を返してください。 /// 例: /// >>> prod_signs(arr: [1, 2, 2, -4]) /// 9 /// >>> prod_signs(arr: [0, 1]) /// 0 /// >>> prod_signs(arr: [] as [Int]) /// nil func prod_signs(arr: [Int]) -> Int? {
reworded
transform
HumanEval_128_prod_signs
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(prod_signs(arr: [1, 2, 2, -4]) == -9) assert(prod_signs(arr...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py
swift
[ "\n}" ]
/// N行とN列 (N >= 2)) のグリッドと正の整数kが与えられた場合、各セルには値が含まれている。 /// 囲[1, N * N](両端を含む)のすべての整数は、グリッドのセルに一度だけ表れる。 /// このグリッド内で長さkの最短の経路を見つける必要がある。任意のセルからスタートでき、 /// 各ステップで隣接するセルに移動できる。言い換えれば、現在のセルと辺を共有するセルに /// 移動できる。長さkの経路とは、正確にk個のセル(必ずしも異なるとは限らない)を訪れる /// ことを意味する。ただし、グリッドから出ることはない。 /// 長さkの2つの経路AとBがある場合、AとBが通るセルの値を順番にリスト化したものを...
reworded
transform
HumanEval_129_minPath
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(minPath(grid: [[1, 2, 3], [4, 5, 6], [7, 8, 9]], k: 3) == [...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py
swift
[ "\n}" ]
/// フィボナッチ数列は、ここ数世紀の間に数学者によって深く研究され、誰もが知っている。 /// しかし、人々が知らないのはトリボナッチ数列である。 /// トリボナッチ数列は再帰によって定義される: /// tri(1) = 3 /// tri(n) = 1 + n / 2, n が偶数の場合. /// tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), n が奇数の場合d. /// 例えば: /// tri(2) = 1 + (2 / 2) = 2 /// tri(4) = 3 /// tri(3) = tri(2) + tri(1) + tri(4) /// ...
reworded
transform
HumanEval_130_tri
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(tri(n: 3) == [1, 3, 2, 8]) assert(tri(n: 4) == [1, 3, 2, 8,...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py
swift
[ "\n}" ]
/// 正の整数 n が与えられた時、奇数桁数の積を返す。 /// 全ての桁が偶数の場合は0を返す。 /// 例えば: /// >>> digits(n: 1) /// 1 /// >>> digits(n: 4) /// 0 /// >>> digits(n: 235) /// 15 func digits(n: Int) -> Int {
reworded
transform
HumanEval_131_digits
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(digits(n: 5) == 5) assert(digits(n: 54) == 5) assert(digits...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py
swift
[ "\n}" ]
/// この関数は、角括弧だけを含む文字列を入力として受け取ります。括弧が有効な順序で /// 並んでいて、その中に少なくとも1つの括弧が入れ子になっている場合、関数はtrueを /// 返すようにしてください。 /// >>> is_nested(string: "[[]]") /// true /// >>> is_nested(string: "[]]]]]]][[[[[]") /// false /// >>> is_nested(string: "[][]") /// false /// >>> is_nested(string: "[]") /// false /// >>> is_nested(string: "[[...
reworded
transform
HumanEval_132_is_nested
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(is_nested(string: "[[]]") == true) assert(is_nested(string:...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py
swift
[ "\n}" ]
/// 数字のリストが与えられます。 /// 与えられたリスト内の各数値をまず切り上げ(天井関数を使って最も近い整数に丸める)、 /// その後それぞれの数値を二乗した値の合計を返してください。 /// 例: /// >>> sum_squares(lst: [1.0, 2.0, 3.0]) /// 14 /// >>> sum_squares(lst: [1.0, 4.0, 9.0]) /// 98 /// >>> sum_squares(lst: [1.0, 3.0, 5.0, 7.0]) /// 84 /// >>> sum_squares(lst: [1.4, 4.2, 0.0]) /// 29 /// >>> sum_s...
reworded
transform
HumanEval_133_sum_squares
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(sum_squares(lst: [1.0, 2.0, 3.0]) == 14) assert(sum_squares...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py
swift
[ "\n}" ]
/// 与えられた文字列の最後の文字がアルファベットであり、かつ単語の一部でなければtrueを、 /// そうでなければfalseを返す関数を作成せよ。 /// 注意:単語とはスペースで区切られた文字の並びである。 /// 例: /// >>> check_if_last_char_is_a_letter(txt: "apple pie") /// false /// >>> check_if_last_char_is_a_letter(txt: "apple pi e") /// true /// >>> check_if_last_char_is_a_letter(txt: "apple pi e ") /// false /...
reworded
transform
HumanEval_134_check_if_last_char_is_a_letter
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(check_if_last_char_is_a_letter(txt: "apple") == false) asse...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py
swift
[ "\n}" ]
/// 直前の要素よりも大きくない要素の中で、最も大きなインデックスを持つ要素を探して /// そのインデックスを返す関数を作成してください。そのような要素が存在しない場合は、 /// -1を返してください。与えられる配列には重複する値は含まれません。 /// 例: /// >>> can_arrange(arr: [1, 2, 4, 3, 5]) /// 3 /// >>> can_arrange(arr: [1, 2, 3]) /// -1 func can_arrange(arr: [Int]) -> Int {
reworded
transform
HumanEval_135_can_arrange
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(can_arrange(arr: [1, 2, 4, 3, 5]) == 3) assert(can_arrange(...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py
swift
[ "\n}" ]
/// リストから最も大きな負の整数と最も小さな正の整数を見つけ、それらをタプル(a, b) /// として返す関数を作成してください。リストに負の整数もしくは正の整数がない場合は、 /// 代わりにnilを返します。 /// 例: /// >>> largest_smallest_integers(lst: [2, 4, 1, 3, 5, 7]) /// (nil, 1) /// >>> largest_smallest_integers(lst: [] as [Int]) /// (nil, nil) /// >>> largest_smallest_integers(lst: [0]) /// (nil, nil) func...
reworded
transform
HumanEval_136_largest_smallest_integers
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(largest_smallest_integers(lst: [2, 4, 1, 3, 5, 7]) == (nil,...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py
swift
[ "\n}" ]
enum Value: Equatable, Hashable { case intValue(Int) case doubleValue(Double) case stringValue(String) } /// 整数、浮動小数点数、または実数を表す文字列を引数として受け取り、その中で最も大きい値を /// その元の型で返す関数を作成してください。もし値が同じであれば、nilを返してください。 /// 注意:実数が文字列として表されている場合、小数点はピリオド(.)またはカンマ(,)の可能性があります。 /// >>> compare_one(a: .intValue(1),...
reworded
transform
HumanEval_137_compare_one
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(compare_one(a: .intValue(1), b: .intValue(2)) == .intValue(...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_137_compare_one.py
swift
[ "\n}" ]
/// 与えられた数値nが、ちょうど4つの正の偶数の合計として表現できるかどうかを評価してください。 /// 例 /// >>> is_equal_to_sum_even(n: 4) /// false /// >>> is_equal_to_sum_even(n: 6) /// false /// >>> is_equal_to_sum_even(n: 8) /// true func is_equal_to_sum_even(n: Int) -> Bool {
reworded
transform
HumanEval_138_is_equal_to_sum_even
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(is_equal_to_sum_even(n: 4) == false) assert(is_equal_to_sum...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py
swift
[ "\n}" ]
/// ブラジリアン階乗は次のように定義される: /// brazilian_factorial(n) = n!* (n-1)! * (n-2)! * ... * 1! /// ただし n > 0 /// 例えば: /// >>> special_factorial(n: 4) /// 288 /// この関数は入力として整数を受け取り、整数の特殊な階乗を返す。 func special_factorial(n: Int) -> Int {
reworded
transform
HumanEval_139_special_factorial
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(special_factorial(n: 4) == 288) assert(special_factorial(n:...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py
swift
[ "\n}" ]
/// 文字列テキストが与えられた場合、その中のすべての空白をアンダースコアに置換し、 /// 文字列が2つ以上の連続した空白を持つ場合、すべての連続した空白を - に置換する /// >>> fix_spaces(text: " Example") /// "Example" /// >>> fix_spaces(text: " Example 1") /// "Example_1" /// >>> fix_spaces(text: " Example 2") /// "_Example_2" /// >>> fix_spaces(text: " Example 3") /// "_Example-3" func fix_sp...
reworded
transform
HumanEval_140_fix_spaces
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(fix_spaces(text: "Example") == "Example") assert(fix_spaces...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py
swift
[ "\n}" ]
/// ファイル名を表す文字列を受け取り、そのファイル名が有効であれば'Yes'を返し、そうでなければ'No' /// を返す関数を作成する。ファイル名が有効であるとみなされるのは、 /// 以下の条件をすべて満たす場合のみである: /// - ファイル名に3桁以上の数字('0'-'9')があってはならない。 /// - ファイル名に含まれるドット '.' はひとつのみ。 /// - ドットの前の部分文字列は空であってはならず、英文字('a'-'z'および'A'-'Z')から始まる文字でなければならない。 /// - ドットの後の部分文字列は、以下のいずれかでなければならない: ['txt'、'exe'、'dll']。 /// 例...
reworded
transform
HumanEval_141_file_name_check
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(file_name_check(file_name: "example.txt") == "Yes") assert(...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py
swift
[ "\n}" ]
/// 文を表す文字列が与えられ、その文には空白で区切られたいくつかの単語が含まれている。 /// 元の文の単語を含みその長さが素数である文字列を返す必要がある。 /// 新しい文字列の単語の順序は元の文字列と同じでなければならない。 /// 例 1: /// >>> words_in_sentence(sentence: "This is a test") /// "is" /// 例 2: /// >>> words_in_sentence(sentence: "lets go for swimming") /// "go for" /// 制約: /// * 1 <= len(sentence) <= 100 /// * s...
reworded
transform
HumanEval_143_words_in_sentence
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(words_in_sentence(sentence: "This is a test") == "is") asse...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py
swift
[ "\n}" ]
/// あなたの仕事は、式 x * n を簡単にする関数を実装することです。 /// この関数は、x * n が整数になる場合はtrueを、そうでない場合はfalseを /// 返します。xとnはともに分数の文字列表現であり、<分子>/<分母>という形式で、 /// 分子と分母はともに正の整数です。 /// xとnが有効な分数であり、分母がゼロでないことは仮定してかまいません。 /// >>> simplify(x: "1/5", n: "5/1") /// true /// >>> simplify(x: "1/6", n: "2/1") /// false /// >>> simplify(x: "7/10", n: "10/...
reworded
transform
HumanEval_144_simplify
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(simplify(x: "1/5", n: "5/1") == true) assert(simplify(x: "1...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py
swift
[ "\n}" ]
/// 各数字の桁の合計に基づいて、与えられた整数のリストを昇順に並べる /// 関数を作成してください。 /// 注意:もし桁の合計が同じである複数の項目がある場合は、 /// 元のリストでの位置に基づいて並べてください。 /// 例えば /// >>> order_by_points(nums: [1, 11, -1, -11, -12]) /// [-1, -11, 1, -12, 11] /// >>> order_by_points(nums: [] as [Int]) /// [] as [Int] func order_by_points(nums: [Int]) -> [Int] {
reworded
transform
HumanEval_145_order_by_points
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(order_by_points(nums: [1, 11, -1, -11, -12]) == [-1, -11, 1...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py
swift
[ "\n}" ]
/// 数値の配列を入力とし、配列中の要素のうち、10より大きく、 /// かつ数値の最初と最後の桁の両方が奇数(1, 3, 5, 7, 9)である要素の数を返す関数を書く。 /// 例えば /// >>> specialFilter(nums: [15, -73, 14, -15]) /// 1 /// >>> specialFilter(nums: [33, -2, -3, 45, 21, 109]) /// 2 func specialFilter(nums: [Int]) -> Int {
reworded
transform
HumanEval_146_specialFilter
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(specialFilter(nums: [5, -2, 1, -5]) == 0) assert(specialFil...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py
swift
[ "\n}" ]
/// 正の整数 n が与えられるので、長さ n の整数配列 a を作成せよ。 /// 各 i (1 ≤ i ≤ n) に対して、 a[i] = i * i - i + 1 とする。 /// i < j < k において、a[i] + a[j] + a[k] が3の倍数となるような三つ組 (a[i], a[j], a[k]) を返す。 /// 例 : /// >>> get_max_triples(n: 5) /// 1 /// 解説: /// a = [1, 3, 7, 13, 21] /// 唯一の妥当な三つ組は (1, 7, 13)である。 func get_max_triples(n: Int) -> Int {
reworded
transform
HumanEval_147_get_max_triples
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(get_max_triples(n: 5) == 1) assert(get_max_triples(n: 6) ==...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py
swift
[ "\n}" ]
/// 文字列のリストを引数として受け取る関数を作成してください。 /// この関数は、リストから奇数の長さを持つ文字列を削除し、 /// 結果として得られるリストを長さで昇順に並べ替えて返します。 /// リストは常に文字列のリストであり、数字の配列ではありません。 /// また、重複する文字列が含まれる可能性があります。 /// リストは各単語の長さで昇順に並べられるべきで、そのルールに従ってソートされたリストを返してください。 /// もし二つの単語が同じ長さであれば、リストをアルファベット順に並べ替えてください。 /// 関数はソートされた順序で文字列のリストを返すべきです。 /// すべての単語が同じ長さを持つと仮定して...
reworded
transform
HumanEval_149_sorted_list_sum
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(sorted_list_sum(lst: ["aa", "a", "aaa"]) == ["aa"]) assert(...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py
swift
[ "\n}" ]
/// 素数である場合はxの値を返し、それ以外の場合はyの値を返す簡単なプログラム。 /// 例: /// >>> x_or_y(n: 7, x: 34, y: 12) /// 34 /// >>> x_or_y(n: 15, x: 8, y: 5) /// 5 func x_or_y(n: Int, x: Int, y: Int) -> Int {
reworded
transform
HumanEval_150_x_or_y
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(x_or_y(n: 7, x: 34, y: 12) == 34) assert(x_or_y(n: 15, x: 8...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py
swift
[ "\n}" ]
/// 数字のリストが与えられた場合、そのリスト内の奇数の数値の二乗の合計を返してください。 /// 負の数や整数でない数は無視してください。 /// >>> double_the_difference(lst: [1, 3, 2, 0]) /// 10 /// >>> double_the_difference(lst: [-1, -2, 0]) /// 0 /// >>> double_the_difference(lst: [9, -2]) /// 81 /// >>> double_the_difference(lst: [0]) /// 0 /// 入力リストが空の場合は0を返すようにしてください。 func doubl...
reworded
transform
HumanEval_151_double_the_difference
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(double_the_difference(lst: [] as [Double]) == 0) assert(dou...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py
swift
[ "\n}" ]
/// 待ち望んでいた出来事の結果がようやく判明したときの感覚は、誰もが覚えていると思う。 /// その瞬間に抱いた感情や思考は、間違いなくメモして比較する価値がある。 /// あなたの仕事は、人がいくつかの試合の結果を正確に予想したかどうかを判断することです。 /// スコアと予想の2つの配列が等しい長さで与えられます。各インデックスは1つの試合を示しています。 /// 各予想がどれだけ外れていたかを示す同じ長さの配列を返してください。予想が正確であれば、 /// その値は0です。そうでなければ、その値は予想とスコアの絶対的な差です。 /// 例: /// >>> compare(game: [1, 2, 3, 4, 5, 1]...
reworded
transform
HumanEval_152_compare
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(compare(game: [1, 2, 3, 4, 5, 1], guess: [1, 2, 3, 4, 2, -2...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py
swift
[ "\n}" ]
/// クラスの名前(文字列)と拡張子のリストが与えられます。 /// この拡張子は、指定されたクラスに追加のクラスをロードするために使用されます。 /// 拡張子の強度は次のように計算されます:CAPは拡張子の名前に含まれる /// 大文字の数、SMは小文字の数です。強度は、CAP - SM で与えられます。 /// 最も強い拡張子を見つけて、この形式の文字列を返してください:ClassName.StrongestExtensionName。 /// 同じ強度を持つ2つ以上の拡張子がある場合は、リストで最初に来るものを選びます。 /// 例えば、"Slices"というクラスと、拡張子のリスト['SErviNGSliCes', '...
reworded
transform
HumanEval_153_Strongest_Extension
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(Strongest_Extension(class_name: "Watashi", extensions: ["tE...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py
swift
[ "\n}" ]
/// 2つの単語が与えられる。2番目の単語またはその回転させた文字列が最初の単語の部分文字列である場合、trueを返す必要がある。 /// >>> cycpattern_check(a: "abcd", b: "abd") /// false /// >>> cycpattern_check(a: "hello", b: "ell") /// true /// >>> cycpattern_check(a: "whassup", b: "psus") /// false /// >>> cycpattern_check(a: "abab", b: "baa") /// true /// >>> cycpattern_check(...
reworded
transform
HumanEval_154_cycpattern_check
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(cycpattern_check(a: "xyzw", b: "xyw") == false) assert(cycp...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py
swift
[ "\n}" ]
/// 整数が与えられた場合、偶数桁数と奇数桁数をそれぞれ持つタプルを返す。 /// 例: /// >>> even_odd_count(num: -12) /// (1, 1) /// >>> even_odd_count(num: 123) /// (1, 2) func even_odd_count(num: Int) -> (Int, Int) {
reworded
transform
HumanEval_155_even_odd_count
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(even_odd_count(num: 7) == (0, 1)) assert(even_odd_count(num...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py
swift
[ "\n}" ]
/// 正の整数が与えられたとき、ローマ数字に相当する文字列を小文字で返す。 /// 制限事項1 <= num <= 1000 /// 例:s: /// >>> int_to_mini_roman(number: 19) /// "xix" /// >>> int_to_mini_roman(number: 152) /// "clii" /// >>> int_to_mini_roman(number: 426) /// "cdxxvi" func int_to_mini_roman(number: Int) -> String {
reworded
transform
HumanEval_156_int_to_mini_roman
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(int_to_mini_roman(number: 19) == "xix") assert(int_to_mini_...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py
swift
[ "\n}" ]
/// 三角形の3辺の長さを与える。三角形が直角三角形ならtrueを、そうでなければfalseを返す。 /// 直角三角形とは、1つの角が直角または90度である三角形のことである。 /// 例: /// >>> right_angle_triangle(a: 3, b: 4, c: 5) /// true /// >>> right_angle_triangle(a: 1, b: 2, c: 3) /// false func right_angle_triangle(a: Int, b: Int, c: Int) -> Bool {
reworded
transform
HumanEval_157_right_angle_triangle
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(right_angle_triangle(a: 3, b: 4, c: 5) == true) assert(righ...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py
swift
[ "\n}" ]
/// 文字列のリストを受け取る関数を書きなさい。 /// リストは異なる単語を含む。異なる固有の文字数が最も多い単語を返す。 /// 複数の文字列が同じ文字数を持つ場合は、辞書順で最初に来るものを返すことにする。 /// >>> find_max(words: ["name", "of", "string"]) /// "string" /// >>> find_max(words: ["name", "enam", "game"]) /// "enam" /// >>> find_max(words: ["aaaaaaa", "bb", "cc"]) /// "aaaaaaa" func find_max(words: [St...
reworded
transform
HumanEval_158_find_max
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(find_max(words: ["name", "of", "string"]) == "string") asse...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py
swift
[ "\n}" ]
/// あなたはお腹を空かせたウサギです。すでに一定数のニンジンを食べました。 /// これからさらにニンジンを食べなければその日の食事は完了しません。 /// あなたは [ 食事の後に食べたニンジンの総数, 食事の後に残ったニンジンの数 ] の配列を返してください。 /// もし残りのニンジンが十分でなければ、あなたは残りのニンジンをすべて食べますが、まだお腹が空いています。 /// 例: /// >>> eat(number: 5, need: 6, remaining: 10) /// [11, 4] /// >>> eat(number: 4, need: 8, remaining: 9) /// [12, 1] ///...
reworded
transform
HumanEval_159_eat
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(eat(number: 5, need: 6, remaining: 10) == [11, 4]) assert(e...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py
swift
[ "\n}" ]
/// 演算子(operator)とオペランド(operand)の2つのリストが与えられる。ひとつ目のリストは /// 基本的な算術演算を持ち、二つ目のリストは整数のリストである。与えられた2つのリストを /// 使って算術式を構築し、その評価結果を返そう。 /// 基本的な算術演算: /// 加算 ( + ) /// 減算 ( - ) /// 乗算 ( * ) /// 階除算 ( // ) /// 指数化 ( ** ) /// 例: /// operator['+', '*', '-'] /// array = [2, 3, 4, 5] /// result = 2 + 3 * 4 - 5 /// => result = ...
reworded
transform
HumanEval_160_do_algebra
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(do_algebra(operator: ["**", "*", "+"], operand: [2, 3, 4, 5...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py
swift
[ "\n}" ]
/// 文字列sが与えられます。 /// もしs[i]がアルファベットなら、その文字の大文字と小文字を反転させる。そうでない場合は、そのままにしておく。 /// もし文字列にアルファベットが一つも含まれていない場合は、文字列全体を逆順にする。 /// 関数は結果の文字列を返すようにします。 /// 例 /// >>> solve(s: "1234") /// "4321" /// >>> solve(s: "ab") /// "AB" /// >>> solve(s: "#a@C") /// "#A@c" func solve(s: String) -> String {
reworded
transform
HumanEval_161_solve
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(solve(s: "AsDf") == "aSdF") assert(solve(s: "1234") == "432...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py
swift
[ "\n}" ]
/// 文字列 text が与えられたとき、その md5 ハッシュと等価な文字列を返す。 /// text' が空文字列の場合は nil を返す。 /// >>> string_to_md5(text: "Hello world") /// "3e25960a79dbc69b674cd4ec67a72c62" func string_to_md5(text: String) -> String? {
reworded
transform
HumanEval_162_string_to_md5
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(string_to_md5(text: "Hello world") == "3e25960a79dbc69b674c...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py
swift
[ "\n}" ]
/// 正の整数aとbが与えられたとき、aとbの間にある偶数の数字を昇順で返してください。 /// 例えば: /// >>> generate_integers(a: 2, b: 8) /// [2, 4, 6, 8] /// >>> generate_integers(a: 8, b: 2) /// [2, 4, 6, 8] /// >>> generate_integers(a: 10, b: 14) /// [] as [Int] func generate_integers(a: Int, b: Int) -> [Int] {
reworded
transform
HumanEval_163_generate_integers
} func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool { if left.count != right.count { return false } for (l, r) in zip(left, right) { if l != r { return false } } return true } assert(generate_integers(a: 2, b: 10) == [2, 4, 6, 8]) assert(gene...
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py
swift