content
stringlengths
263
5.24M
pred_label
stringclasses
1 value
pred_score_pos
float64
0.6
1
package com.termux.shared.termux.terminal; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.termux.terminal.TerminalSession; import com.termux.terminal.TerminalSessionClient; public class TermuxTerminalSessionClientBase implements TerminalSessionClient { public TermuxTerminalS...
__label__POS
0.948188
""" get_closest_vowel(word::String)::String You are given a word. Your task is to find the closest vowel that stands between two consonants from the right side of the word (case sensitive). Vowels in the beginning and ending doesn't count. Return empty string if you didn't find any vowel met the above condition. ...
__label__POS
0.957989
""" sorted_list_sum(xs::Vector{String})::Vector{String} Write a function that accepts a list of strings as a parameter, deletes the strings that have odd lengths from it, and returns the resulted list with a sorted order, The list is always a list of strings and never an array of numbers, and it may contain dupli...
__label__POS
0.995545
""" hex_key(num::String)::Int 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). Hexadecimal digits a...
__label__POS
0.998576
package com.termux.shared.termux.extrakeys; import androidx.annotation.NonNull; import java.util.HashMap; /** The {@link Class} that implements special buttons for {@link ExtraKeysView}. */ public class SpecialButton { private static final HashMap<String, SpecialButton> map = new HashMap<>(); public static...
__label__POS
0.983703
""" do_algebra(operator::Vector{String}, operand::Vector{Int}) Given two lists operator, and operand. The first list has basic algebra operations, and the second list is a list of integers. Use the two given lists to build the algebric expression and return the evaluation of this expression. The basic algebra ope...
__label__POS
0.927935
""" compare_one(a::Union{Integer, AbstractFloat, AbstractString}, b::Union{Integer, AbstractFloat, AbstractString})::Union{Integer, AbstractFloat, AbstractString, Nothing} Create a function that takes integers, floats, or strings representing real numbers, and returns the larger variable in its given variable type...
__label__POS
0.760955
""" simplify(x::String, n::String)::Bool Your task is to implement a function that will simplify the expression x * n. The function returns True if x * n evaluates to a whole number and False otherwise. Both x and n, are string representation of a fraction, and have the following format, <numerator>/<denominator> ...
__label__POS
0.739614
""" sort_array_based_on_head_tail(xs::Int)::Vector{Int} 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, la...
__label__POS
0.998608
""" find_max(words::Vector{String})::String Write a function that accepts a list of strings. The list contains different words. Return the word with maximum number of unique characters. If multiple strings have maximum number of unique characters, return the one which comes first in lexicographical order. # Examp...
__label__POS
0.990969
""" is_sorted(xs::Vector{Int})::Bool Given a list of numbers, return whether or not they are sorted in ascending order. If list has more than 1 duplicate of the same number, return `false`. Assume no negative numbers and only integers. # Examples ```jldoctest julia> is_sorted([5]) true julia> is_sorted([1, 2, 3...
__label__POS
0.994784
package com.termux.shared.termux.shell.command.environment; import android.content.Context; import androidx.annotation.NonNull; import com.termux.shared.shell.command.ExecutionCommand; import com.termux.shared.shell.command.environment.ShellCommandShellEnvironment; import com.termux.shared.shell.command.environment....
__label__POS
0.848873
""" get_row(xs::Vector{Vector{Int}}, x::Int)::Vector{Tuple{Int, Int}} 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 `xs`, and integer `x`, find integers `x` in the list `xs`, and return list of ...
__label__POS
0.983276
""" compare(game::Vector{Int}, guess::Vector{Int})::Vector{Int} I think we all remember that feeling when the result of some long-awaited event is finally known. The feelings and thoughts you have at that moment are definitely worth noting down and comparing. Your task is to determine if a person correctly guessed...
__label__POS
0.822061
package com.termux.shared.termux.shell.command.environment; import android.content.Context; import android.content.pm.ApplicationInfo; import android.content.pm.PackageInfo; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.termux.shared.android.PackageUtils; import com.termux.share...
__label__POS
0.682436
""" cycpattern_check(a::String , b::String)::Bool 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. # Example ```jldoctest julia> cycpattern_check("abcd", "abd") false julia> cycpattern_check("hello", "ell") true julia> cycpattern_chec...
__label__POS
0.999425
""" histogram(s::String)::Dict{String, Int} Given a string representing a space separated lowercase letters, return a dictionary of the letter with the most repetition and containing the corresponding count. If several letters have the same occurrence, return all of them. # Examples ```jldoctest julia> histogram...
__label__POS
0.611502
package com.termux.shared.termux.terminal.io; import android.content.Context; import android.os.Build; import android.os.Handler; import android.os.Looper; import android.os.SystemClock; import android.os.VibrationEffect; import android.os.Vibrator; public class BellHandler { private static BellHandler instance =...
__label__POS
0.776192
""" odd_count(xs::Vector{String})::Vector{String} Given a list of strings, where each string consists of only digits, return a list. Each element `i` of the output should be "the number of odd elements in the string i of the input." where all the i"s should be replaced by the number of odd digits in the i"th strin...
__label__POS
0.995439
""" factorize(n::Int)::Vector{Int} 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. # Examples ```jldo...
__label__POS
0.988001
""" match_parens(lst::Vector{String})::String You are given a list of two strings, both strings consist of open parentheses "(" or close parentheses ")" only. Your job is to check if it is possible to concatenate the two strings in some order, that the resulting string will be good. A string S is considered to be ...
__label__POS
0.994512
package com.termux.shared.termux.settings.preferences; /* * Version: v0.16.0 * * Changelog * * - 0.1.0 (2021-03-12) * - Initial Release. * * - 0.2.0 (2021-03-13) * - Added `KEY_LOG_LEVEL` and `KEY_TERMINAL_VIEW_LOGGING_ENABLED`. * * - 0.3.0 (2021-03-16) * - Changed to per app scoping of vari...
__label__POS
0.987878
""" file_name_check(file_name::String)::String Create a function which takes a string representing a file's name, and returns 'Yes' if the the file's name is valid, and returns 'No' otherwise. A file's name is considered to be valid if and only if all the following conditions are met: - There should not be more tha...
__label__POS
0.968593
""" even_odd_palindrome(n::Int)::Tuple{Int, Int} Given a positive integer n, return a tuple that has the number of even and odd integer palindromes that fall within the range(1, n), inclusive. !!! note 1. 1 <= n <= 10^3 2. returned tuple has the number of even and odd integer palindromes respectively. ...
__label__POS
0.997769
package com.termux.shared.termux.settings.properties; import com.google.common.collect.ImmutableBiMap; import com.termux.shared.settings.properties.SharedProperties; import com.termux.shared.termux.TermuxConstants; import com.termux.terminal.TerminalEmulator; import com.termux.view.TerminalView; import java.util.Arra...
__label__POS
0.868049
package com.termux.shared.termux.settings.properties; import android.content.Context; import androidx.annotation.NonNull; import com.termux.shared.termux.TermuxConstants; public class TermuxAppSharedProperties extends TermuxSharedProperties { private static TermuxAppSharedProperties properties; private T...
__label__POS
0.991593
package com.termux.shared.activity.media; import androidx.annotation.IdRes; import androidx.annotation.NonNull; import androidx.appcompat.app.ActionBar; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; public class AppCompatActivityUtils { /** Set activity toolbar. ...
__label__POS
0.911088
""" parse_nested_parens(paren_string::String)::Vector{Int} 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. ...
__label__POS
0.985077
package com.termux.shared.shell.command.result; import android.app.PendingIntent; import java.util.Formatter; public class ResultConfig { /** Defines {@link PendingIntent} that should be sent with the result of the command. We cannot * implement {@link java.io.Serializable} because {@link PendingIntent} ca...
__label__POS
0.835919
""" intersection(interval1::Vector{Int}, interval2::Vector{Int})::String You are given two intervals, where each interval is a pair of integers. For example, interval = (start, end) = (1, 2). The given intervals are closed which means that the interval (start, end) includes both start and end. For each given inter...
__label__POS
0.999847
package com.termux.shared.shell.command.result; import com.termux.shared.errors.Errno; /** The {@link Class} that defines Result Sender error messages and codes. */ public class ResultSenderErrno extends Errno { public static final String TYPE = "Result Sender Error"; /* Errors for null or empty parameters...
__label__POS
0.997556
package com.termux.shared.shell.command.result; import com.termux.shared.errors.Error; import java.io.Serializable; import java.util.ArrayList; import java.util.List; public class ResultData implements Serializable { /** The stdout of command. */ public final StringBuilder stdout = new StringBuilder(); ...
__label__POS
0.997482
""" min_path(grid::Vector{Vector{Int}}, k::Int)::Vector{Int} Given a grid with `N` rows and `N` columns (`N >= 2`) and a positive integer `k`, each cell of the grid contains a value. Every integer in the range `[1, N * N]` inclusive appears exactly once on the cells of the grid. You have to find the minimum path ...
__label__POS
0.999321
""" add_elements(xs::Vector{Int}, k::Int)::Int Given a non-empty array of integers `xs` and an integer `k`, return the sum of the elements with at most two digits from the first k elements of `xs`. Constraints: 1. 1 <= length(xs) <= 100 2. 1 <= k <= length(xs) # Examples ```jldoctest julia> add_elements([111...
__label__POS
0.994135
package com.termux.shared.shell.command.environment; import android.content.Context; import androidx.annotation.NonNull; import com.termux.shared.shell.command.ExecutionCommand; import java.util.HashMap; /** * Environment for {@link ExecutionCommand}. */ public class ShellCommandShellEnvironment { /** Envir...
__label__POS
0.963057
""" fruit_distribution(s::String, n::Int)::Int 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 and an...
__label__POS
0.963815
""" will_it_fly(q::Vector{Int}, w::Int)::Bool 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`. # Examples ```jldoctest juli...
__label__POS
0.999954
""" max_fill(grid::Vector{Vector{Int}}, capacity::Int)::Int You are given a rectangular grid of wells. Each row represents a single well, and each 1 in a row represents a single unit of water. Each well has a corresponding bucket that can be used to extract water from it, and all buckets have the same capacity. Yo...
__label__POS
0.995764
""" pluck(xs::Vector{Int})::Vector{Int} 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...
__label__POS
0.990343
""" anti_shuffle(s::String)::String 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 should keep the...
__label__POS
0.999286
""" tri(n::Int)::Vector{Int} Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in the last couple centuries. However, what people don't know is Tribonacci sequence. Tribonacci sequence is defined by the recurrence: tri(1) = 1 tri(n) = 1 + n / 2, if n is even. tri(n) = tri(n - 1) + tri(...
__label__POS
0.987337
""" words_in_sentence(sentence::String)::String You are given a string representing a sentence, the sentence contains some words separated by a space, and you have to return a string that contains the words from the original sentence, whose lengths are prime numbers, the order of the words in the new string should...
__label__POS
0.997521
""" reverse_string(s::String)::String You are given a string `s`. If `s[i]` is a letter, reverse its case from lower to upper or vise versa, otherwise keep it as it is. If the string contains no letters, reverse the string. The function should return the resulted string. # Examples ```jldoctest julia> reverse_s...
__label__POS
0.999159
""" get_odd_collatz(n::Int)::Vector{BigInt} Given a positive integer `n`, return a sorted list that has the odd numbers in collatz sequence. The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined as follows: start with any positive integer n. Then each term is obtained from the pre...
__label__POS
0.996599
""" valid_date(date::String)::Bool You have to write a function which validates a given date string and returns `true` if the date is valid otherwise `false` The date is valid if all of the following rules are satisfied: 1. The date string is not empty. 2. The number of days is not less than 1 or higher than 31...
__label__POS
0.89522
""" bf(planet1::String, planet2::String)::NTuple There are eight planets in our solar system: the closerst to the Sun is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, Uranus, Neptune. Write a function that takes two planet names as strings `planet1` and `planet2`. The function should return a ...
__label__POS
0.893447
""" skjkasdkd(xs::Vector{Int})::Int You are given a list of integers. You need to find the largest prime value and return the sum of its digits. # Examples ```jldoctest julia> skjkasdkd([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3]) 10 julia> skjkasdkd([1, 0, 1, 8, 2, 4597, 2, 1, 3, ...
__label__POS
0.999684
""" select_words(s::String, n::Int)::Vector{<:AbstractString} Given a string `s` and a natural number `n`, you have been tasked to implement a function that returns a list of all words from string `s` that contain exactly `n` consonants, in order these words appear in the string `s`. If the string `s` is empty the...
__label__POS
0.998533
""" split_words(txt::String)::Union{Vector{<:AbstractString},Int} Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you should split on commas "," if no commas exists you should return the number of lower-case letters with odd order in the alphabet, ord("a") ...
__label__POS
0.974839
""" same_chars(s0::String, s1::String)::Bool Check if two words have the same characters. # Examples ```jldoctest julia> same_chars("eabcdzzzz", "dddzzzzzzzddeddabc") true julia> same_chars("abcd", "dddddddabc") true julia> same_chars("dddddddabc", "abcd") true julia> same_chars("eabcd", "dddddddabc") false ...
__label__POS
0.986867
""" largest_smallest_integers(xs::Vector{Int})::Tuple{Union{Nothing, Int}, Union{Nothing,Int}} Create a function that returns a tuple (a, b), where "a" is the largest of negative integers, and "b" is the smallest of positive integers in a list. If there is no negative or positive integers, return them as `nothing`...
__label__POS
0.948361
""" total_match(xs::Vector{String}, ys::Vector{String})::Vector{String} 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...
__label__POS
0.999625
""" separate_paren_groups(paren_string::String)::Vector{String} 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 nes...
__label__POS
0.965885
""" parse_music(music_string::String)::Vector{Int} Input to this function is a string representing musical notes in a special ASCII format. Your task is to parse this string and return list of integers corresponding to how many beats does each not last. Here is a legend: - `"o"` - whole note, lasts four beats ...
__label__POS
0.695493
""" count_up_to(n::Int)::Vector{Int} 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. # Example ```jldoctest julia> count_up_to(5) 2-element Vector{Int64}: 2 3 julia> count_up_to(11) 4-element Vector{Int64}: 2 3 5 ...
__label__POS
0.999887
""" reverse_delete(s::String, c::String)::Tuple{String, Bool} 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` then check if the result string is palindrome. A string is called palindrome if it reads the same backward as forward. You should...
__label__POS
0.983804
""" move_one_ball(xs::Vector{Int})::Bool We have an array `xs` of N integers xs[1], xs[2], ..., xs[N].The numbers in the array will be randomly ordered. Your task is to determine if it is possible to get an array sorted in non-decreasing order by performing the following operation on the given array: You are allow...
__label__POS
0.997858
""" eat(number::Int, need::Int, remaining::Int)::Vector{Int} You're a hungry rabbit, and you already have eaten a certain number of carrots, but now you need to eat more carrots to complete the day's meals. you should return an array of [ total number of eaten carrots after your meals, the number of carrots left a...
__label__POS
0.99569
""" right_angle_triangle(a::Number, b::Number, c::Number)::Bool Given the lengths of the three sides of a triangle. Return `true` if the three sides form a right-angled triangle, `false` otherwise. A right-angled triangle is a triangle in which one angle is right angle or 90 degree. # Examples ```jldoctest julia...
__label__POS
0.978892
""" triangle_area3(a::Number, b::Number, c::Number)::Number 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 t...
__label__POS
0.998595
""" by_length(xs::Vector{Int})::Vector{String} Given an array of integers, sort the integers that are between 1 and 9 inclusive, reverse the resulting array, and then replace each digit by its corresponding name from "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine". If the array is empty, re...
__label__POS
0.995859
""" get_closest_vowel(word::String)::String You are given a word. Your task is to find the closest vowel that stands between two consonants from the right side of the word (case sensitive). Vowels in the beginning and ending doesn't count. Return empty string if you didn't find any vowel met the above condition. ...
__label__POS
0.890819
""" sorted_list_sum(xs::Vector{String})::Vector{String} Write a function that accepts a list of strings as a parameter, deletes the strings that have odd lengths from it, and returns the resulted list with a sorted order, The list is always a list of strings and never an array of numbers, and it may contain dupli...
__label__POS
0.997158
""" exchange(lst1::Vector{Int}, lst2::Vector{Int})::String In this problem, you will implement a function that takes two lists of numbers, and determines whether it is possible to perform an exchange of elements between them to make lst1 a list of only even numbers. There is no limit on the number of exchanged ele...
__label__POS
0.957357
""" hex_key(num::String)::Int 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). Hexadecimal digits a...
__label__POS
0.992581
""" do_algebra(operator::Vector{String}, operand::Vector{Int}) Given two lists operator, and operand. The first list has basic algebra operations, and the second list is a list of integers. Use the two given lists to build the algebric expression and return the evaluation of this expression. The basic algebra ope...
__label__POS
0.962676
""" order_by_points(nums::Vector{Int})::Vector{Int} Write a function which sorts the given list of integers in ascending order according to the sum of their digits. Note: if there are several items with similar sum of their digits, order them based on their index in original list. # Examples ```jldoctest julia> ...
__label__POS
0.999852
""" sort_numbers(numbers::String)::String Input is a space-delimited string of numberals from "zero" to "nine". Valid choices are "zero", "one", "two", "three", "four", "five", "six", "seven", "eight" and "nine". Return the string with numbers sorted from smallest to largest # Examples ```jldoctest julia> sort...
__label__POS
0.665598
""" compare_one(a::Union{Integer, AbstractFloat, AbstractString}, b::Union{Integer, AbstractFloat, AbstractString})::Union{Integer, AbstractFloat, AbstractString, Nothing} Create a function that takes integers, floats, or strings representing real numbers, and returns the larger variable in its given variable type...
__label__POS
0.931327
""" simplify(x::String, n::String)::Bool Your task is to implement a function that will simplify the expression x * n. The function returns True if x * n evaluates to a whole number and False otherwise. Both x and n, are string representation of a fraction, and have the following format, <numerator>/<denominator> ...
__label__POS
0.662563
""" sort_array_based_on_head_tail(xs::Int)::Vector{Int} 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, la...
__label__POS
0.999728
""" find_max(words::Vector{String})::String Write a function that accepts a list of strings. The list contains different words. Return the word with maximum number of unique characters. If multiple strings have maximum number of unique characters, return the one which comes first in lexicographical order. # Examp...
__label__POS
0.999844
""" get_row(xs::Vector{Vector{Int}}, x::Int)::Vector{Tuple{Int, Int}} 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 `xs`, and integer `x`, find integers `x` in the list `xs`, and return list of ...
__label__POS
0.975271
""" fibfib(n::Int)::Int 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 fibfi...
__label__POS
0.955289
""" compare(game::Vector{Int}, guess::Vector{Int})::Vector{Int} I think we all remember that feeling when the result of some long-awaited event is finally known. The feelings and thoughts you have at that moment are definitely worth noting down and comparing. Your task is to determine if a person correctly guessed...
__label__POS
0.943691
""" histogram(s::String)::Dict{String, Int} Given a string representing a space separated lowercase letters, return a dictionary of the letter with the most repetition and containing the corresponding count. If several letters have the same occurrence, return all of them. # Examples ```jldoctest julia> histogram...
__label__POS
0.955389
""" is_multiply_prime(a::Int)::Bool 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. # Examples ```jldoctest julia> is_multiply_prime(30) # 30 = 2 * 3 * 5 true ``` """ function is_multiply_prime(a::Int)::Boo...
__label__POS
0.999819
""" odd_count(xs::Vector{String})::Vector{String} Given a list of strings, where each string consists of only digits, return a list. Each element `i` of the output should be "the number of odd elements in the string i of the input." where all the i"s should be replaced by the number of odd digits in the i"th strin...
__label__POS
0.996947
""" match_parens(lst::Vector{String})::String You are given a list of two strings, both strings consist of open parentheses "(" or close parentheses ")" only. Your job is to check if it is possible to concatenate the two strings in some order, that the resulting string will be good. A string S is considered to be ...
__label__POS
0.934756
""" file_name_check(file_name::String)::String Create a function which takes a string representing a file's name, and returns 'Yes' if the the file's name is valid, and returns 'No' otherwise. A file's name is considered to be valid if and only if all the following conditions are met: - There should not be more tha...
__label__POS
0.700276
""" even_odd_palindrome(n::Int)::Tuple{Int, Int} Given a positive integer n, return a tuple that has the number of even and odd integer palindromes that fall within the range(1, n), inclusive. !!! note 1. 1 <= n <= 10^3 2. returned tuple has the number of even and odd integer palindromes respectively. ...
__label__POS
0.999489
""" parse_nested_parens(paren_string::String)::Vector{Int} 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. ...
__label__POS
0.99776
""" check_if_last_char_is_a_letter(s::String)::Bool Create a function that returns `true` if the last character of a given string is an alphabetical character and is not a part of a word, and `false` otherwise. Note: "word" is a group of characters separated by space. # Examples ```jldoctest julia> check_if_las...
__label__POS
0.978056
""" sort_array(arr::Vector{Int})::Vector{Int} In this Kata, you have to sort an array of non-negative integers according to number of ones in their binary representation in ascending order. For similar number of ones, sort based on decimal value. It must be implemented like this: # Examples ```jldoctest julia> ...
__label__POS
0.694768
""" intersection(interval1::Vector{Int}, interval2::Vector{Int})::String You are given two intervals, where each interval is a pair of integers. For example, interval = (start, end) = (1, 2). The given intervals are closed which means that the interval (start, end) includes both start and end. For each given inter...
__label__POS
0.999938
""" min_path(grid::Vector{Vector{Int}}, k::Int)::Vector{Int} Given a grid with `N` rows and `N` columns (`N >= 2`) and a positive integer `k`, each cell of the grid contains a value. Every integer in the range `[1, N * N]` inclusive appears exactly once on the cells of the grid. You have to find the minimum path ...
__label__POS
0.999666
""" fruit_distribution(s::String, n::Int)::Int 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 and an...
__label__POS
0.804714
""" search(numbers::Vector)::Int 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 ex...
__label__POS
0.999537
""" find_closest_elements(numbers::Vector{Float64})::Tuple{Float64, Float64} 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). # Examples ```jldoctest julia> find_closest_elements([1.0, 2.0, ...
__label__POS
0.999523
""" will_it_fly(q::Vector{Int}, w::Int)::Bool 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`. # Examples ```jldoctest juli...
__label__POS
0.99988
""" max_fill(grid::Vector{Vector{Int}}, capacity::Int)::Int You are given a rectangular grid of wells. Each row represents a single well, and each 1 in a row represents a single unit of water. Each well has a corresponding bucket that can be used to extract water from it, and all buckets have the same capacity. Yo...
__label__POS
0.994933
""" pluck(xs::Vector{Int})::Vector{Int} 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...
__label__POS
0.992802
""" tri(n::Int)::Vector{Int} Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in the last couple centuries. However, what people don't know is Tribonacci sequence. Tribonacci sequence is defined by the recurrence: tri(1) = 1 tri(n) = 1 + n / 2, if n is even. tri(n) = tri(n - 1) + tri(...
__label__POS
0.842588
""" strange_sort_list(xs::Vector{Int})::Vector{Int} 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 ```jldoctest julia> strange_sort_list([1, 2, 3, 4]) 4-element Vector{Int6...
__label__POS
0.999942
""" words_in_sentence(sentence::String)::String You are given a string representing a sentence, the sentence contains some words separated by a space, and you have to return a string that contains the words from the original sentence, whose lengths are prime numbers, the order of the words in the new string should...
__label__POS
0.997309
""" get_odd_collatz(n::Int)::Vector{BigInt} Given a positive integer `n`, return a sorted list that has the odd numbers in collatz sequence. The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined as follows: start with any positive integer n. Then each term is obtained from the pre...
__label__POS
0.99637
""" valid_date(date::String)::Bool You have to write a function which validates a given date string and returns `true` if the date is valid otherwise `false` The date is valid if all of the following rules are satisfied: 1. The date string is not empty. 2. The number of days is not less than 1 or higher than 31...
__label__POS
0.826049
""" bf(planet1::String, planet2::String)::NTuple There are eight planets in our solar system: the closerst to the Sun is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, Uranus, Neptune. Write a function that takes two planet names as strings `planet1` and `planet2`. The function should return a ...
__label__POS
0.858487
""" smallest_change(xs::Vector{Int})::Int 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. # Examp...
__label__POS
0.9997
""" skjkasdkd(xs::Vector{Int})::Int You are given a list of integers. You need to find the largest prime value and return the sum of its digits. # Examples ```jldoctest julia> skjkasdkd([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3]) 10 julia> skjkasdkd([1, 0, 1, 8, 2, 4597, 2, 1, 3, ...
__label__POS
0.998007