Skip to content

Commit

Permalink
Add text descriptions of the tasks (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
WeetHet authored Oct 16, 2024
1 parent a4c0dd6 commit 0887bd1
Show file tree
Hide file tree
Showing 132 changed files with 475 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .zed/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"tab_size": 2,
"languages": {
"Dafny": {
"tab_size": 2,
}
},
"format_on_save": "off"
}
File renamed without changes.
File renamed without changes.
84 changes: 84 additions & 0 deletions scripts/generate_text_descriptions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
from pathlib import Path
import re

DESCRIPTION_TEMPLATE = """\
You have to write {cnt} {functions} in dafny, using the given helper functions
The {descriptions} as follows:
"""

SUBTASK_TEMPLATE = """\
function `{name}`: {task}
"""

NO_EXAMPLES = {
"010": ["is_palindrome"],
"041": ["car_race_collision"],
"050": ["encode_shift", "decode_shift"],
"083": ["starts_one_ends"],
}

POSSIBLE_ENDS = [
">>>",
"Examples",
"for example",
"For example",
"Example",
"example",
# "\"\"\""
]


def description_from_match(number: str, name: str, task: str) -> str:
if number in NO_EXAMPLES and name in NO_EXAMPLES[number]:
end = len(task)
else:
end, pos = -1, 0
POSSIBLE_ENDS.append(name)
while end == -1:
end = task.find(POSSIBLE_ENDS[pos])
pos += 1
POSSIBLE_ENDS.pop()
task = task[:end].replace(" ", "").replace("\n", " ").strip()
while " " in task:
task = task.replace(" ", " ")
return SUBTASK_TEMPLATE.format(name=name, task=task)


assert (
Path(".").absolute().stem == "HumanEval-Dafny"
), "script should be run from HumanEval-Dafny directory"

human_eval = Path(".").absolute().parent / "verified-cogen" / "benches" / "HumanEval"
text_descriptions = Path() / "text-descriptions"
text_descriptions.mkdir(exist_ok=True)

desc_regex = re.compile(r"def ([a-zA-Z0-9_]*)\(.*\)(:?\s*->\s*.*)?:\n")

files = sorted(Path(".").glob("*.dfy"))
for i, file in enumerate(files):
number = file.stem[:3]
name = file.stem[4:].replace("-", "_")

prompt_path = human_eval / f"{number}_{name}/{name}.prompt"
print(f"Done {i + 1}/{len(files)} ({prompt_path.name})")
prompt = prompt_path.read_text()

matches = list(desc_regex.finditer(prompt))
desc = DESCRIPTION_TEMPLATE.format(
cnt=len(matches),
functions="function" if len(matches) == 1 else "functions",
descriptions="description is" if len(matches) == 1 else "descriptions are",
)
for match in matches:
desc_start = prompt.find('"""', match.end())
if desc_start == -1:
desc_start = prompt.find("'''", match.end())
desc_end = prompt.find("'''", desc_start + 3)
else:
desc_end = prompt.find('"""', desc_start + 3)
desc += description_from_match(
number, match.groups()[0], prompt[desc_start + 3 : desc_end]
) # type: ignore

with (text_descriptions / f"{file.stem}.txt").open("w") as out:
out.write(desc)
3 changes: 3 additions & 0 deletions text-descriptions/000-has_close_elements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `has_close_elements`: Check if in given list of numbers, are any two numbers closer to each other than given threshold.
3 changes: 3 additions & 0 deletions text-descriptions/001-separate-paren-groups.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `separate_paren_groups`: Input to this function is a string containing multiple groups of nested parentheses. Your goal is to separate those group into separate strings and return the list of those. Separate groups are balanced (each open brace is properly closed) and not nested within each other Ignore any spaces in the input string.
3 changes: 3 additions & 0 deletions text-descriptions/002-truncate.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `truncate_number`: Given a positive floating point number, it can be decomposed into and integer part (largest integer smaller than given number) and decimals (leftover part always smaller than 1). Return the decimal part of the number.
3 changes: 3 additions & 0 deletions text-descriptions/003-below_zero.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `below_zero`: You're given a list of deposit and withdrawal operations on a bank account that starts with zero balance. Your task is to detect if at any point the balance of account fallls below zero, and at that point function should return True. Otherwise it should return False.
3 changes: 3 additions & 0 deletions text-descriptions/004-mean_absolute_derivation.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `mean_absolute_deviation`: For a given list of input numbers, calculate Mean Absolute Deviation around the mean of this dataset. Mean Absolute Deviation is the average absolute difference between each element and a centerpoint (mean in this case): MAD = average | x - x_mean |
3 changes: 3 additions & 0 deletions text-descriptions/005-intersperse.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `intersperse`: Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
3 changes: 3 additions & 0 deletions text-descriptions/006-parse_nested_parens.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `parse_nested_parens`: 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.
3 changes: 3 additions & 0 deletions text-descriptions/007-filter_by_substring.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `filter_by_substring`: Filter an input list of strings only for ones that contain given substring
3 changes: 3 additions & 0 deletions text-descriptions/008-sum_product.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `sum_product`: 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.
3 changes: 3 additions & 0 deletions text-descriptions/009-rolling_max.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `rolling_max`: From a given list of integers, generate a list of rolling maximum element found until given moment in the sequence.
4 changes: 4 additions & 0 deletions text-descriptions/010-is_palindrome.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
You have to write 2 functions in dafny, using the given helper functions
The descriptions are as follows:
function `is_palindrome`: Test if given string is a palindrome
function `make_palindrome`: Find the shortest palindrome that begins with a supplied string. Algorithm idea is simple: - Find the longest postfix of supplied string that is a palindrome. - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.
3 changes: 3 additions & 0 deletions text-descriptions/011-string_xor.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `string_xor`: Input are two strings a and b consisting only of 1s and 0s. Perform binary XOR on these inputs and return result also as a string.
3 changes: 3 additions & 0 deletions text-descriptions/012-longest.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `longest`: Out of list of strings, return the longest one. Return the first one in case of multiple strings of the same length. Return None in case the input list is empty.
3 changes: 3 additions & 0 deletions text-descriptions/013-greatest_common_divisor.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `greatest_common_divisor`: Return a greatest common divisor of two integers a and b
3 changes: 3 additions & 0 deletions text-descriptions/014-all_prefixes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `all_prefixes`: Return list of all prefixes from shortest to longest of the input string
3 changes: 3 additions & 0 deletions text-descriptions/016-count_distinct_characters.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `count_distinct_characters`: Given a string, find out how many distinct characters (regardless of case) does it consist of
3 changes: 3 additions & 0 deletions text-descriptions/018-how_many_times.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `how_many_times`: Find how many times a given substring can be found in the original string. Count overlaping cases.
3 changes: 3 additions & 0 deletions text-descriptions/020-find_closest_elements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `find_closest_elements`: From a supplied list of numbers (of length at least two) select and return two that are the closest to each other and return them in order (smaller number, larger number).
3 changes: 3 additions & 0 deletions text-descriptions/021-rescale_to_unit.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `rescale_to_unit`: Given list of numbers (of at least two elements), apply a linear transform to that list, such that the smallest number will become 0 and the largest will become 1
3 changes: 3 additions & 0 deletions text-descriptions/023-strlen.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `strlen`: Return length of given string
3 changes: 3 additions & 0 deletions text-descriptions/024-largest-divisor.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `largest_divisor`: For a given number n, find the largest number that divides n evenly, smaller than n
3 changes: 3 additions & 0 deletions text-descriptions/025-factorize.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `factorize`: Return list of prime factors of given integer in the order from smallest to largest. Each of the factors should be listed number of times corresponding to how many times it appeares in factorization. Input number should be equal to the product of all factors
3 changes: 3 additions & 0 deletions text-descriptions/026-remove_duplicates.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `remove_duplicates`: From a list of integers, remove all elements that occur more than once. Keep order of elements left the same as in the input.
3 changes: 3 additions & 0 deletions text-descriptions/027-flip_case.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `flip_case`: For a given string, flip lowercase characters to uppercase and uppercase to lowercase.
3 changes: 3 additions & 0 deletions text-descriptions/029-filter_by_prefix.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `filter_by_prefix`: Filter an input list of strings only for ones that start with a given prefix.
3 changes: 3 additions & 0 deletions text-descriptions/030-get-positive.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `get_positive`: Return only positive numbers in the list.
3 changes: 3 additions & 0 deletions text-descriptions/031-is-prime.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `is_prime`: Return true if a given number is prime, and false otherwise.
3 changes: 3 additions & 0 deletions text-descriptions/033-sort_third.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `sort_third`: This function takes a list l and returns a list l' such that l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal to the values of the corresponding indicies of l, but sorted.
3 changes: 3 additions & 0 deletions text-descriptions/034-unique.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `unique`: Return sorted unique elements in a list
3 changes: 3 additions & 0 deletions text-descriptions/035-max-element.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `max_element`: Return maximum element in the list.
3 changes: 3 additions & 0 deletions text-descriptions/036-fizz_buzz.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `fizz_buzz`: Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.
3 changes: 3 additions & 0 deletions text-descriptions/037-sort_even.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `sort_even`: This function takes a list l and returns a list l' such that l' is identical to l in the odd indicies, while its values at the even indicies are equal to the values of the even indicies of l, but sorted.
3 changes: 3 additions & 0 deletions text-descriptions/040-triples-sum-to-zero.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `triples_sum_to_zero`: triples_sum_to_zero takes a list of integers as an input. it returns True if there are three distinct elements in the list that sum to zero, and False otherwise.
3 changes: 3 additions & 0 deletions text-descriptions/041-car_race_collision.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `car_race_collision`: Imagine a road that's a perfectly straight infinitely long line. n cars are driving left to right; simultaneously, a different set of n cars are driving right to left. The two sets of cars start out being very far from each other. All cars move in the same speed. Two cars are said to collide when a car that's moving left to right hits a car that's moving right to left. However, the cars are infinitely sturdy and strong; as a result, they continue moving in their trajectory as if they did not collide. This function outputs the number of such collisions.
3 changes: 3 additions & 0 deletions text-descriptions/042-incr-list.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `incr_list`: Return list with elements incremented by 1.
3 changes: 3 additions & 0 deletions text-descriptions/043-pairs-sum-to-zero.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `pairs_sum_to_zero`: pairs_sum_to_zero takes a list of integers as an input. it returns True if there are two distinct elements in the list that sum to zero, and False otherwise.
3 changes: 3 additions & 0 deletions text-descriptions/045-triangle_area.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `triangle_area`: Given length of a side and high return area for a triangle.
3 changes: 3 additions & 0 deletions text-descriptions/046-fib4.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `fib4`: The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows: fib4(0) -> 0 fib4(1) -> 0 fib4(2) -> 2 fib4(3) -> 0 fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4). Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.
3 changes: 3 additions & 0 deletions text-descriptions/048-is-palindrome.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `is_palindrome`: Checks if given string is a palindrome
3 changes: 3 additions & 0 deletions text-descriptions/048-is_palindrome.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `is_palindrome`: Checks if given string is a palindrome
3 changes: 3 additions & 0 deletions text-descriptions/049-modp.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `modp`: Return 2^n modulo p (be aware of numerics).
4 changes: 4 additions & 0 deletions text-descriptions/050-encode_shift.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
You have to write 2 functions in dafny, using the given helper functions
The descriptions are as follows:
function `encode_shift`: returns encoded string by shifting every character by 5 in the alphabet.
function `decode_shift`: takes as input string encoded with encode_shift function. Returns decoded string.
3 changes: 3 additions & 0 deletions text-descriptions/051-remove-vowels.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `remove_vowels`: remove_vowels is a function that takes string and returns string without vowels.
3 changes: 3 additions & 0 deletions text-descriptions/052-below-threshold.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `below_threshold`: Return True if all numbers in the list l are below threshold t.
3 changes: 3 additions & 0 deletions text-descriptions/053-add.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `add`: Add two numbers x and y
3 changes: 3 additions & 0 deletions text-descriptions/054-same-chars.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `same_chars`: Check if two words have the same characters.
3 changes: 3 additions & 0 deletions text-descriptions/055-fib.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `fib`: Return n-th Fibonacci number.
3 changes: 3 additions & 0 deletions text-descriptions/057-monotonic.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `monotonic`: Return True is list elements are monotonically increasing or decreasing.
3 changes: 3 additions & 0 deletions text-descriptions/058-common.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `common`: Return sorted unique common elements for two lists.
3 changes: 3 additions & 0 deletions text-descriptions/059-largest-prime-factor.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `largest_prime_factor`: Return the largest prime factor of n. Assume n > 1 and is not a prime.
3 changes: 3 additions & 0 deletions text-descriptions/060-sum_to_n.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `sum_to_n`: sum_to_n is a function that sums numbers from 1 to n.
3 changes: 3 additions & 0 deletions text-descriptions/062-derivative.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `derivative`: xs represent coefficients of a polynomial. xs[0] + xs[1] * x + xs[2] * x^2 + .... Return derivative of this polynomial in the same form.
3 changes: 3 additions & 0 deletions text-descriptions/063-fibfib.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `fibfib`: 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 element of the fibfib number sequence.
3 changes: 3 additions & 0 deletions text-descriptions/064-vowels_count.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `vowels_count`: 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:
3 changes: 3 additions & 0 deletions text-descriptions/065-circular_shift.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `circular_shift`: 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.
3 changes: 3 additions & 0 deletions text-descriptions/066-digitSum.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `digitSum`: Task Write a function that takes a string as input and returns the sum of the upper characters only' ASCII codes.
3 changes: 3 additions & 0 deletions text-descriptions/068-pluck.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `pluck`: "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 return the node that has smallest index. The plucked node should be returned in a list, [ smalest_value, its index ], If there are no even values or the given array is empty, return [].
3 changes: 3 additions & 0 deletions text-descriptions/069-search.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `search`: 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 no such a value exist, return -1.
3 changes: 3 additions & 0 deletions text-descriptions/070-strange_sort_list.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `strange_sort_list`: 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.
3 changes: 3 additions & 0 deletions text-descriptions/072-will_it_fly.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You have to write 1 function in dafny, using the given helper functions
The description is as follows:
function `will_it_fly`: 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.
Loading

0 comments on commit 0887bd1

Please sign in to comment.