main
mbrp_validation.parquet
text → text

code_and_tests
You are a pragmatic Rust programmer who enjoys test driven development. Given the following question, write a Rust function to complete the task. Make the code simple and easy to understand. The code should pass `cargo build` and `cargo clippy`. Do not add a main function. Try to limit library usage to the standard library std. Respond with only the Rust function and nothing else. Be careful with your types, and try to limit yourself to the basic built in types and standard library functions. When writing the function you can think through how to solve the problem and perform reasoning in the comments above the function. Then write unit tests for the function you defined. Write three unit tests for the function. The tests should be a simple line delimited list of assert! or assert_eq! statements. When writing the unit tests you can have comments specifying what you are testing in plain english. An example output should look like the following: ```rust /// Reasoning goes here /// and can be multi-line fn add_nums(x: i32, y: i32) -> i32 { x + y } ``` ```tests // Test adding small positive numbers assert_eq!(add_nums(1, 2), 3); // Test adding two negative numbers assert_eq!(add_nums(-10, -2), -14); // Test adding a positive and a negative number assert_eq!(add_nums(-10, 2), 8); ``` Make sure to only respond with two blocks, a ```rust``` block and a ```tests``` block. Here is the question: {rust_prompt}
eval/gemma-3
Mar 19, 2025, 10:34 PM UTC
Mar 19, 2025, 10:45 PM UTC
00:10:41
90 rows
64727 tokens$ 0.0193
90 rows processed, 64727 tokens used ($0.0193)
completed
5 columns, 90 rows
task_id
rust_prompt
511
Write a rust function to find the minimum sum of factors of a given number.
512
Write a rust function to count the element frequency in the mixed nested tuple.
513
Write a Rust function to convert a tuple into a list by adding the given string after every element.
514
Write a Rust function to find the summation of tuple elements in the given tuple list.
515
Write a rust function to check if there is a subset with sum divisible by m.
516
Write a Rust function to sort a list of elements using radix sort.
517
Write a rust function to find the largest positive number from the given list.
518
Write a rust function to find the square root of a perfect number.
519
Write a Rust function to calculate the volume of a tetrahedron.
520
Write a Rust function to find the lcm of the given array elements.
521
Write a rust function to check if the triangle is scalene or not.
522
Write a rust function to find the longest bitonic subsequence for the given array.
523
Write a rust function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function.
524
Write a rust function to find the sum of maximum increasing subsequence of the given array.
525
Write a rust function to check whether two given lines are parallel or not.
526
Write a rust function to capitalize first and last letters of each word of a given string.
527
Write a rust function to find all pairs in an integer array whose sum is equal to a given number.
528
Write a rust function to find the list of lists with minimum length.
529
Write a rust function to find the nth Jacobsthal-Lucas number.
530
Write a Rust function to find the ratio of negative numbers in an array of integers.
531
Write a rust function to find the minimum number of coins that make a given value.
532
Write a rust function to check if the two given strings are permutations of each other.
533
Write a rust function to remove particular data type elements from the given tuple.
534
Write a **Rust** function to search a literals string in a string and also find the location within the original string where the pattern occurs.