diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml index f0e98a42..50c74c77 100644 --- a/.github/workflows/flake8.yml +++ b/.github/workflows/flake8.yml @@ -5,10 +5,14 @@ on: branches: [ "main" ] paths: - "translation/**" + - "irt/**" + - "samples/**" pull_request: branches: [ "main" ] paths: - "translation/**" + - "irt/**" + - "samples/**" jobs: build: @@ -28,4 +32,4 @@ jobs: python -m pip install flake8 - name: Check with flake8 run: | - flake8 --ignore=E501 translation + flake8 --ignore=E501 translation irt samples diff --git a/translation/drafts/0 b/translation/drafts/0 deleted file mode 100644 index 354fc982..00000000 --- a/translation/drafts/0 +++ /dev/null @@ -1,15 +0,0 @@ -""" Check if in given list of numbers, are any two numbers closer to each other than - given threshold. - >>> has_close_elements([1.0, 2.0, 3.0], 0.5) - False - >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3) - True - """ - -""" -Diye gaye numbers ki list mein yeh check karo ki kya koi do numbers ek dusre se diye gaye threshold se zyada close hain. - >>> has_close_elements([1.0, 2.0, 3.0], 0.5) - False - >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3) - True -""" diff --git a/translation/drafts/1 b/translation/drafts/1 deleted file mode 100644 index 5fc33d8c..00000000 --- a/translation/drafts/1 +++ /dev/null @@ -1,16 +0,0 @@ -""" 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. - >>> separate_paren_groups('( ) (( )) (( )( ))') - ['()', '(())', '(()())'] - """ - -""" -Is function ka input ek string hai jisme nested parentheses ke kayi groups hai. Aapka goal hai - un groups ko alag alag strings me separate karna aur unki list return karna. - Separate groups balanced hote hain (har open brace sahi se close hota hai) aur ek dusre ke andar nested nahi hote. - Input string me koi bhi spaces ko ignore karo. - >>> separate_paren_groups('( ) (( )) (( )( ))') - ['()', '(())', '(()())'] -""" diff --git a/translation/drafts/10 b/translation/drafts/10 deleted file mode 100644 index 22d8d909..00000000 --- a/translation/drafts/10 +++ /dev/null @@ -1,5 +0,0 @@ -""" Test if given string is a palindrome """ - -""" -Check karo ki diya gaya string palindrome hai ya nahi. -""" diff --git a/translation/drafts/100 b/translation/drafts/100 deleted file mode 100644 index 45359095..00000000 --- a/translation/drafts/100 +++ /dev/null @@ -1,27 +0,0 @@ -""" - Given a positive integer n, you have to make a pile of n levels of stones. - The first level has n stones. - The number of stones in the next level is: - - the next odd number if n is odd. - - the next even number if n is even. - Return the number of stones in each level in a list, where element at index - i represents the number of stones in the level (i+1). - - Examples: - >>> make_a_pile(3) - [3, 5, 7] - """ - -""" -Ek positive integer n diya gaya hai, aapko n levels ki ek pile of stones banani hai. - Pehle level me n stones honge. - Agla level stones ka number hoga: - - agla odd number agar n odd hai. - - agla even number agar n even hai. - Har level me stones ki sankhya ko ek list me return karo, jaha index - i ki element level (i+1) me stones ki sankhya ko darshata hai. - - Udaharan: - >>> make_a_pile(3) - [3, 5, 7] -""" \ No newline at end of file diff --git a/translation/drafts/101 b/translation/drafts/101 deleted file mode 100644 index 154cd1ae..00000000 --- a/translation/drafts/101 +++ /dev/null @@ -1,17 +0,0 @@ -""" - You will be given a string of words separated by commas or spaces. Your task is - to split the string into words and return an array of the words. - - For example: - words_string("Hi, my name is John") == ["Hi", "my", "name", "is", "John"] - words_string("One, two, three, four, five, six") == ["One", "two", "three", "four", "five", "six"] - """ - -""" -Aapko ek string di jayegi jisme words commas ya spaces se separated honge. Aapka task hai - string ko words mein split karna aur words ki array return karna. - - Jaise ki: - words_string("Hi, my name is John") == ["Hi", "my", "name", "is", "John"] - words_string("One, two, three, four, five, six") == ["One", "two", "three", "four", "five", "six"] -""" \ No newline at end of file diff --git a/translation/drafts/102 b/translation/drafts/102 deleted file mode 100644 index 0c6476b5..00000000 --- a/translation/drafts/102 +++ /dev/null @@ -1,18 +0,0 @@ -"""This function takes two positive numbers x and y and returns the - biggest even integer number that is in the range [x, y] inclusive. If - there's no such number, then the function should return -1. - - For example: - choose_num(12, 15) = 14 - choose_num(13, 12) = -1 - """ - -""" -Yeh function do positive numbers x aur y leta hai aur return karta hai - sabse bada even integer jo range [x, y] mein inclusive hai. Agar - aisa koi number nahi hai, toh function ko -1 return karna chahiye. - - Jaise ki: - choose_num(12, 15) = 14 - choose_num(13, 12) = -1 -""" \ No newline at end of file diff --git a/translation/drafts/103 b/translation/drafts/103 deleted file mode 100644 index 28b0a026..00000000 --- a/translation/drafts/103 +++ /dev/null @@ -1,22 +0,0 @@ -"""You are given two positive integers n and m, and your task is to compute the - average of the integers from n through m (including n and m). - Round the answer to the nearest integer and convert that to binary. - If n is greater than m, return -1. - Example: - rounded_avg(1, 5) => "0b11" - rounded_avg(7, 5) => -1 - rounded_avg(10, 20) => "0b1111" - rounded_avg(20, 33) => "0b11010" - """ - -""" -Aapko do positive integers n aur m diye gaye hain, aur aapka task hai n se lekar m tak ke integers ka - average compute karna (n aur m ko bhi include karte hue). - Answer ko nearest integer tak round karo aur usko binary mein convert karo. - Agar n m se bada hai, to -1 return karo. - Udaharan: - rounded_avg(1, 5) => "0b11" - rounded_avg(7, 5) => -1 - rounded_avg(10, 20) => "0b1111" - rounded_avg(20, 33) => "0b11010" -""" \ No newline at end of file diff --git a/translation/drafts/104 b/translation/drafts/104 deleted file mode 100644 index 22772024..00000000 --- a/translation/drafts/104 +++ /dev/null @@ -1,23 +0,0 @@ -"""Given a list of positive integers x. return a sorted list of all - elements that hasn't any even digit. - - Note: Returned list should be sorted in increasing order. - - For example: - >>> unique_digits([15, 33, 1422, 1]) - [1, 15, 33] - >>> unique_digits([152, 323, 1422, 10]) - [] - """ - -""" -Diye gaye positive integers ki list x me Woh saare elements ki sorted list return karo jisme koi bhi even digit nahi hai. - - Dhyan de: Return ki gayi list ko increasing order me sort kiya jana chahiye. - - Jaise ki: - >>> unique_digits([15, 33, 1422, 1]) - [1, 15, 33] - >>> unique_digits([152, 323, 1422, 10]) - [] -""" diff --git a/translation/drafts/105 b/translation/drafts/105 deleted file mode 100644 index 7b1b0a2e..00000000 --- a/translation/drafts/105 +++ /dev/null @@ -1,43 +0,0 @@ -""" - 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". - - For example: - arr = [2, 1, 1, 4, 5, 8, 2, 3] - -> sort arr -> [1, 1, 2, 2, 3, 4, 5, 8] - -> reverse arr -> [8, 5, 4, 3, 2, 2, 1, 1] - return ["Eight", "Five", "Four", "Three", "Two", "Two", "One", "One"] - - If the array is empty, return an empty array: - arr = [] - return [] - - If the array has any strange number ignore it: - arr = [1, -1 , 55] - -> sort arr -> [-1, 1, 55] - -> reverse arr -> [55, 1, -1] - return = ['One'] - """ - -""" -Ek array diya gaya hai integers ka, integers ko sort karo jo 1 se 9 ke beech mein hai, - resulting array ko reverse karo, aur phir har digit ko uske corresponding name se replace karo - "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine". - - Jaise ki: - arr = [2, 1, 1, 4, 5, 8, 2, 3] - -> arr ko sort karo -> [1, 1, 2, 2, 3, 4, 5, 8] - -> arr ko reverse karo -> [8, 5, 4, 3, 2, 2, 1, 1] - return ["Eight", "Five", "Four", "Three", "Two", "Two", "One", "One"] - - Agar array khali hai, toh ek khali array return karo: - arr = [] - return [] - - Agar array mein koi ajeeb number hai toh use ignore karo: - arr = [1, -1 , 55] - -> arr ko sort karo -> [-1, 1, 55] - -> arr ko reverse karo -> [55, 1, -1] - return = ['One'] -""" \ No newline at end of file diff --git a/translation/drafts/106 b/translation/drafts/106 deleted file mode 100644 index 43e4401b..00000000 --- a/translation/drafts/106 +++ /dev/null @@ -1,18 +0,0 @@ -""" Implement the function f that takes n as a parameter, - and returns a list of size n, such that the value of the element at index i is the factorial of i if i is even - or the sum of numbers from 1 to i otherwise. - i starts from 1. - the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i). - Example: - f(5) == [1, 2, 6, 24, 15] - """ - -""" -Function f ko implement karo jo ek parameter n leta hai, - aur ek size n ki list return karta hai, jiske index i pe element ki value i ka factorial ho agar i even hai - varna 1 se lekar i tak ke numbers ka sum ho. - i 1 se shuru hota hai. - i ka factorial 1 se lekar i tak ke numbers ka multiplication hota hai (1 * 2 * ... * i). - Udaharan: - f(5) == [1, 2, 6, 24, 15] -""" diff --git a/translation/drafts/107 b/translation/drafts/107 deleted file mode 100644 index 7881e252..00000000 --- a/translation/drafts/107 +++ /dev/null @@ -1,45 +0,0 @@ -""" - 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. - - Example 1: - - Input: 3 - Output: (1, 2) - Explanation: - Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd. - - Example 2: - - Input: 12 - Output: (4, 6) - Explanation: - Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd. - - Note: - 1. 1 <= n <= 10^3 - 2. returned tuple has the number of even and odd integer palindromes respectively. - """ - -""" -Ek positive integer n diye jane par ek tuple return karo jisme un even aur odd integer palindromes ki sankhya ho jo range(1, n), inclusive, mein aate hai. - - Udaharan 1: - - Input: 3 - Output: (1, 2) - Explanation: - Integer palindrome hain 1, 2, 3. Inme se ek even hai, aur do odd hain. - - Udaharan 2: - - Input: 12 - Output: (4, 6) - Explanation: - Integer palindrome hain 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. Inme se chaar even hain, aur 6 odd hain. - - Dhyan de: - 1. 1 <= n <= 10^3 - 2. returned tuple mei even aur odd integer palindromes respetively ki sankhya hoti hai. - -""" diff --git a/translation/drafts/108 b/translation/drafts/108 deleted file mode 100644 index d7143927..00000000 --- a/translation/drafts/108 +++ /dev/null @@ -1,18 +0,0 @@ -""" - Write a function count_nums which takes an array of integers and returns - the number of elements which has a sum of digits > 0. - If a number is negative, then its first signed digit will be negative: - e.g. -123 has signed digits -1, 2, and 3. - >>> count_nums([]) == 0 - >>> count_nums([-1, 11, -11]) == 1 - >>> count_nums([1, 1, 2]) == 3 - """ - -""" -Ek function count_nums likho jo ek array of integers leta ho aur un elements ki sankhya return karta hi jinke digits ka sum > 0 hai. - Agar koi number negative hai, to uska pehla signed digit negative hoga: - jaise ki -123 ke signed digits honge -1, 2, aur 3. - >>> count_nums([]) == 0 - >>> count_nums([-1, 11, -11]) == 1 - >>> count_nums([1, 1, 2]) == 3 -""" diff --git a/translation/drafts/109 b/translation/drafts/109 deleted file mode 100644 index 90c5bb17..00000000 --- a/translation/drafts/109 +++ /dev/null @@ -1,46 +0,0 @@ -"""We have an array 'arr' of N integers arr[1], arr[2], ..., arr[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 allowed to perform right shift operation any number of times. - - One right shift operation means shifting all elements of the array by one - position in the right direction. The last element of the array will be moved to - the starting position in the array i.e. 0th index. - - If it is possible to obtain the sorted array by performing the above operation - then return True else return False. - If the given array is empty then return True. - - Note: The given list is guaranteed to have unique elements. - - For Example: - - move_one_ball([3, 4, 5, 1, 2])==>True - Explanation: By performin 2 right shift operations, non-decreasing order can - be achieved for the given array. - move_one_ball([3, 5, 4, 1, 2])==>False - Explanation:It is not possible to get non-decreasing order for the given - array by performing any number of right shift operations. - - """ - -""" -Humare paas ek array 'arr' hai N integers arr[1], arr[2], ..., arr[N] ka. Array mein numbers randomly order mein honge. Aapka task hai yeh determine karna ki kya hume non-decreasing order mein sorted array mil sakta hai, diye gaye array par niche diye gaye operation ko perform karke: - Aapko right shift operation ko kitni bhi baar perform karne ki anumati hai. - - Ek right shift operation ka matlab hai array ke saare elements ko ek position right direction mein shift karna. Array ka last element array ke starting position yaani 0th index par move ho jayega. - - Agar upar diye gaye operation ko perform karke sorted array mil sakta hai to True return karo, nahi to False return karo. - Agar diya gaya array khali hai to True return karo. - - Note: Diye gaye list mein unique elements honge. - - Udaharan ke liye: - - move_one_ball([3, 4, 5, 1, 2])==>True - Explanation: 2 right shift operations perform karke, diye gaye array ke liye non-decreasing order prapt kiya ja sakta hai. - move_one_ball([3, 5, 4, 1, 2])==>False - Explanation: Kisi bhi number of right shift operations perform karke diye gaye array ke liye non-decreasing order prapt karna sambhav nahi hai. - -""" \ No newline at end of file diff --git a/translation/drafts/11 b/translation/drafts/11 deleted file mode 100644 index fdd33188..00000000 --- a/translation/drafts/11 +++ /dev/null @@ -1,12 +0,0 @@ -""" 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. - >>> string_xor('010', '110') - '100' - """ - -""" -Input do strings a aur b honge jo sirf 1s aur 0s se bane honge. - In inputs par binary XOR perform karo aur result ko bhi ek string ke roop mein return karo. - >>> string_xor('010', '110') - '100' -""" \ No newline at end of file diff --git a/translation/drafts/110 b/translation/drafts/110 deleted file mode 100644 index 461779f9..00000000 --- a/translation/drafts/110 +++ /dev/null @@ -1,26 +0,0 @@ -"""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 elements between lst1 and lst2. - If it is possible to exchange elements between the lst1 and lst2 to make - all the elements of lst1 to be even, return "YES". - Otherwise, return "NO". - For example: - exchange([1, 2, 3, 4], [1, 2, 3, 4]) => "YES" - exchange([1, 2, 3, 4], [1, 5, 3, 4]) => "NO" - It is assumed that the input lists will be non-empty. - """ - -""" -Is problem mein, aapko ek function implement karna hai jo do list of numbers leta hai, - aur yeh determine karta hai ki kya inke beech elements ka exchange karke - lst1 ko sirf even numbers ki list banaya ja sakta hai. - lst1 aur lst2 ke beech exchanged elements ki sankhya par koi limit nahi hai. - Agar lst1 aur lst2 ke beech elements exchange karke - lst1 ke saare elements ko even banaya ja sakta hai, to "YES" return karo. - Varna, "NO" return karo. - Jaise ki: - exchange([1, 2, 3, 4], [1, 2, 3, 4]) => "YES" - exchange([1, 2, 3, 4], [1, 5, 3, 4]) => "NO" - Maan liya jata hai ki input lists khali nahi hogi. -""" \ No newline at end of file diff --git a/translation/drafts/111 b/translation/drafts/111 deleted file mode 100644 index 40fc8470..00000000 --- a/translation/drafts/111 +++ /dev/null @@ -1,25 +0,0 @@ -"""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. - - Example: - histogram('a b c') == {'a': 1, 'b': 1, 'c': 1} - histogram('a b b a') == {'a': 2, 'b': 2} - histogram('a b c a b') == {'a': 2, 'b': 2} - histogram('b b b b a') == {'b': 4} - histogram('') == {} - - """ - -""" -Ek string di gayi hai jo space separated lowercase letters ko represent karti hai, return karo ek dictionary - jisme sabse zyada repeat hone wale letter aur unke corresponding count ho. - Agar kai letters ka occurrence same hai, to un sabhi ko return karo. - - Udaharan: - histogram('a b c') == {'a': 1, 'b': 1, 'c': 1} - histogram('a b b a') == {'a': 2, 'b': 2} - histogram('a b c a b') == {'a': 2, 'b': 2} - histogram('b b b b a') == {'b': 4} - histogram('') == {} -""" \ No newline at end of file diff --git a/translation/drafts/112 b/translation/drafts/112 deleted file mode 100644 index fdab2bfa..00000000 --- a/translation/drafts/112 +++ /dev/null @@ -1,23 +0,0 @@ -"""Task - We are given two strings s and c, you have to deleted all the characters in s that are equal to any character in c - then check if the result string is palindrome. - A string is called palindrome if it reads the same backward as forward. - You should return a tuple containing the result string and True/False for the check. - Example - For s = "abcde", c = "ae", the result should be ('bcd',False) - For s = "abcdef", c = "b" the result should be ('acdef',False) - For s = "abcdedcba", c = "ab", the result should be ('cdedc',True) - """ - -""" -Task - Humare paas do strings s aur c di gayi hain, aapko s mein se un sabhi characters ko delete karna hai jo c ke kisi bhi character ke barabar hain - phir check karo ki resultant string palindrome hai ya nahi. - Ek string ko palindrome tabhi kaha jata hai jab woh samne se aur peeche se padne mein ek jaisi ho. - Aapko ek tuple return karna hai jisme result string aur True/False check ke liye hoga. - Udaharan - Agar s = "abcde", c = "ae", toh result ('bcd',False) hona chahiye - Agar s = "abcdef", c = "b" toh result ('acdef',False) hona chahiye - Agar s = "abcdedcba", c = "ab", toh result ('cdedc',True) hona chahiye - -""" diff --git a/translation/drafts/113 b/translation/drafts/113 deleted file mode 100644 index ac94041d..00000000 --- a/translation/drafts/113 +++ /dev/null @@ -1,23 +0,0 @@ -"""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 string of the input. - - >>> odd_count(['1234567']) - ["the number of odd elements 4n the str4ng 4 of the 4nput."] - >>> odd_count(['3',"11111111"]) - ["the number of odd elements 1n the str1ng 1 of the 1nput.", - "the number of odd elements 8n the str8ng 8 of the 8nput."] - """ - -""" -Ek strings ki list di gayi hai, jahan har string sirf digits se bani hoti hai, ek list return karo. - Output ki har element i ko "input ki string i mein odd elements ki sankhya." ke roop mein hona chahiye, jahan saari i's ko input ki i'th string mein odd digits ki sankhya se replace kar dena chahiye. - - >>> odd_count(['1234567']) - ["input ki string 4 mein odd elements ki sankhya 4."] - >>> odd_count(['3',"11111111"]) - ["input ki string 1 mein odd elements ki sankhya 1.", - "input ki string 8 mein odd elements ki sankhya 8."] - -""" \ No newline at end of file diff --git a/translation/drafts/114 b/translation/drafts/114 deleted file mode 100644 index 23022a46..00000000 --- a/translation/drafts/114 +++ /dev/null @@ -1,14 +0,0 @@ -""" - Given an array of integers nums, find the minimum sum of any non-empty sub-array - of nums. - Example - minSubArraySum([2, 3, 4, 1, 2, 4]) == 1 - minSubArraySum([-1, -2, -3]) == -6 - """ - -""" -Ek integer array nums diya gaya hai, usme se kisi bhi non-empty sub-array ka minimum sum dhundho. - Udaharan - minSubArraySum([2, 3, 4, 1, 2, 4]) == 1 - minSubArraySum([-1, -2, -3]) == -6 -""" \ No newline at end of file diff --git a/translation/drafts/115 b/translation/drafts/115 deleted file mode 100644 index 054fb002..00000000 --- a/translation/drafts/115 +++ /dev/null @@ -1,67 +0,0 @@ -""" - 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. - Your task is to use the buckets to empty the wells. - Output the number of times you need to lower the buckets. - - Example 1: - Input: - grid : [[0,0,1,0], [0,1,0,0], [1,1,1,1]] - bucket_capacity : 1 - Output: 6 - - Example 2: - Input: - grid : [[0,0,1,1], [0,0,0,0], [1,1,1,1], [0,1,1,1]] - bucket_capacity : 2 - Output: 5 - - Example 3: - Input: - grid : [[0,0,0], [0,0,0]] - bucket_capacity : 5 - Output: 0 - - Constraints: - * all wells have the same length - * 1 <= grid.length <= 10^2 - * 1 <= grid[:,1].length <= 10^2 - * grid[i][j] -> 0 | 1 - * 1 <= capacity <= 10 - """ - -""" -Aapko ek rectangular grid di gayi hai jisme wells hain. Har row ek well ko represent karti hai, - aur row me har 1 ek unit water ko represent karta hai. - Har well ke paas ek corresponding bucket hoti hai jiska use usme se water extract karne ke liye kiya ja sakta hai, - aur saare buckets ka capacity same hota hai. - Aapka task hai buckets ka use karke wells ko empty karna. - Output me aapko ye batana hai ki kitni baar aapko buckets ko lower karna padega. - - Example 1: - Input: - grid : [[0,0,1,0], [0,1,0,0], [1,1,1,1]] - bucket_capacity : 1 - Output: 6 - - Example 2: - Input: - grid : [[0,0,1,1], [0,0,0,0], [1,1,1,1], [0,1,1,1]] - bucket_capacity : 2 - Output: 5 - - Example 3: - Input: - grid : [[0,0,0], [0,0,0]] - bucket_capacity : 5 - Output: 0 - - Constraints: - * saare wells ka length same hota hai - * 1 <= grid.length <= 10^2 - * 1 <= grid[:,1].length <= 10^2 - * grid[i][j] -> 0 | 1 - * 1 <= capacity <= 10 -""" \ No newline at end of file diff --git a/translation/drafts/116 b/translation/drafts/116 deleted file mode 100644 index 25e89e35..00000000 --- a/translation/drafts/116 +++ /dev/null @@ -1,20 +0,0 @@ -""" - 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: - >>> sort_array([1, 5, 2, 3, 4]) == [1, 2, 3, 4, 5] - >>> sort_array([-2, -3, -4, -5, -6]) == [-6, -5, -4, -3, -2] - >>> sort_array([1, 0, 2, 3, 4]) [0, 1, 2, 3, 4] - """ - -""" -Is Kata mein, aapko ek non-negative integers ki array ko sort karna hai unke binary representation mein ones ki sankhya ke hisaab se ascending order mein. - Agar ones ki sankhya same ho, toh decimal value ke hisab se sort karo. - - Isko aise implement karna hai: - >>> sort_array([1, 5, 2, 3, 4]) == [1, 2, 3, 4, 5] - >>> sort_array([-2, -3, -4, -5, -6]) == [-6, -5, -4, -3, -2] - >>> sort_array([1, 0, 2, 3, 4]) == [0, 1, 2, 3, 4] -""" diff --git a/translation/drafts/117 b/translation/drafts/117 deleted file mode 100644 index e96e9c37..00000000 --- a/translation/drafts/117 +++ /dev/null @@ -1,26 +0,0 @@ -"""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 then the function should return an empty list. - Note: you may assume the input string contains only letters and spaces. - Examples: - select_words("Mary had a little lamb", 4) ==> ["little"] - select_words("Mary had a little lamb", 3) ==> ["Mary", "lamb"] - select_words("simple white space", 2) ==> [] - select_words("Hello world", 4) ==> ["world"] - select_words("Uncle sam", 3) ==> ["Uncle"] - """ - -""" -Ek string s aur ek natural number n diya gaya hai, aapko ek function implement karna hai jo - string s se exactly n consonants wale saare words ko ek list mein return kare, jis order mein ye words string s mein appear hote hain. - Agar string s khali hai to function ko ek khali list return karni chahiye. - Note: Aap maan sakte ho ki input string mein sirf letters aur spaces honge. - Examples: - select_words("Mary had a little lamb", 4) ==> ["little"] - select_words("Mary had a little lamb", 3) ==> ["Mary", "lamb"] - select_words("simple white space", 2) ==> [] - select_words("Hello world", 4) ==> ["world"] - select_words("Uncle sam", 3) ==> ["Uncle"] - -""" \ No newline at end of file diff --git a/translation/drafts/118 b/translation/drafts/118 deleted file mode 100644 index 40a08902..00000000 --- a/translation/drafts/118 +++ /dev/null @@ -1,30 +0,0 @@ -"""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. - - You may assume that the given string contains English letter only. - - Example: - get_closest_vowel("yogurt") ==> "u" - get_closest_vowel("FULL") ==> "U" - get_closest_vowel("quick") ==> "" - get_closest_vowel("ab") ==> "" - """ - -""" -Aapko ek word diya gaya hai. Aapka task hai right side se dekhte hue us vowel ko dhundna hai jo - do consonants ke beech mein hai (case sensitive). - - Shuruat aur ending mein jo vowels hain unka count nahi hoga. Agar aapko koi bhi vowel upar diye gaye - condition ke hisaab se nahi mila toh khali string return karo. - - Aap maan sakte ho ki diya gaya string sirf English letters se bana hua hai. - - Udaharan: - get_closest_vowel("yogurt") ==> "u" - get_closest_vowel("FULL") ==> "U" - get_closest_vowel("quick") ==> "" - get_closest_vowel("ab") ==> "" -""" \ No newline at end of file diff --git a/translation/drafts/119 b/translation/drafts/119 deleted file mode 100644 index 65401b22..00000000 --- a/translation/drafts/119 +++ /dev/null @@ -1,28 +0,0 @@ -""" - 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 good if and only if all parentheses in S - are balanced. For example: the string '(())()' is good, while the string - '())' is not. - Return 'Yes' if there's a way to make a good string, and return 'No' otherwise. - - Examples: - match_parens(['()(', ')']) == 'Yes' - match_parens([')', ')']) == 'No' - """ - -""" -Aapko do strings ki ek list di gayi hai, dono strings me sirf open - parentheses '(' ya close parentheses ')' hain. - Aapka kaam ye check karna hai ki kya in dono strings ko kisi order me concatenate karne se - resulting string acchi banegi. - Ek string S sirf aur sirf tabhi acchi maani jayegi agar usme saare parentheses balanced ho. Jaise ki: string '(())()' acchi hai, jabki string - '())' acchi nahi hai. - Agar acchi string banane ka koi tarika ho to 'Yes' return karo, anyatha 'No' return karo. - - Udaharan: - match_parens(['()(', ')']) == 'Yes' - match_parens([')', ')']) == 'No' -""" diff --git a/translation/drafts/12 b/translation/drafts/12 deleted file mode 100644 index d5051f03..00000000 --- a/translation/drafts/12 +++ /dev/null @@ -1,19 +0,0 @@ -""" 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. - >>> longest([]) - - >>> longest(['a', 'b', 'c']) - 'a' - >>> longest(['a', 'bb', 'ccc']) - 'ccc' - """ - -""" -String ki list se, sabse lamba string return karo. Agar same length ke multiple strings ho to pehla string return karo. Agar input list khali ho to None return karo. - >>> longest([]) - - >>> longest(['a', 'b', 'c']) - 'a' - >>> longest(['a', 'bb', 'ccc']) - 'ccc' -""" \ No newline at end of file diff --git a/translation/drafts/120 b/translation/drafts/120 deleted file mode 100644 index 7d909b87..00000000 --- a/translation/drafts/120 +++ /dev/null @@ -1,48 +0,0 @@ -""" - Given an array arr of integers and a positive integer k, return a sorted list - of length k with the maximum k numbers in arr. - - Example 1: - - Input: arr = [-3, -4, 5], k = 3 - Output: [-4, -3, 5] - - Example 2: - - Input: arr = [4, -4, 4], k = 2 - Output: [4, 4] - - Example 3: - - Input: arr = [-3, 2, 1, 2, -1, -2, 1], k = 1 - Output: [2] - - Note: - 1. The length of the array will be in the range of [1, 1000]. - 2. The elements in the array will be in the range of [-1000, 1000]. - 3. 0 <= k <= len(arr) - """ - -""" -Integers ka ek array arr aur ek positive integer k diye jane par ek sorted list return karo jiski lambai k ho aur jiske elements arr ke maximum k numbers hai. - - Example 1: - - Input: arr = [-3, -4, 5], k = 3 - Output: [-4, -3, 5] - - Example 2: - - Input: arr = [4, -4, 4], k = 2 - Output: [4, 4] - - Example 3: - - Input: arr = [-3, 2, 1, 2, -1, -2, 1], k = 1 - Output: [2] - - Note: - 1. Array ki lambai [1, 1000] ki range mein hogi. - 2. Array ke elements [-1000, 1000] ki range mein honge. - 3. 0 <= k <= len(arr) -""" diff --git a/translation/drafts/121 b/translation/drafts/121 deleted file mode 100644 index cf5ae589..00000000 --- a/translation/drafts/121 +++ /dev/null @@ -1,18 +0,0 @@ -"""Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions. - - - Examples - solution([5, 8, 7, 1]) ==> 12 - solution([3, 3, 3, 3, 3]) ==> 9 - solution([30, 13, 24, 321]) ==>0 - """ - -""" -Ek non-empty list di gayi hai integers ki, return karo sum of all odd elements jo even positions pe hain. - - Udaharan - solution([5, 8, 7, 1]) ==> 12 - solution([3, 3, 3, 3, 3]) ==> 9 - solution([30, 13, 24, 321]) ==>0 - -""" \ No newline at end of file diff --git a/translation/drafts/122 b/translation/drafts/122 deleted file mode 100644 index 5f24a166..00000000 --- a/translation/drafts/122 +++ /dev/null @@ -1,26 +0,0 @@ -""" - Given a non-empty array of integers arr and an integer k, return - the sum of the elements with at most two digits from the first k elements of arr. - - Example: - - Input: arr = [111,21,3,4000,5,6,7,8,9], k = 4 - Output: 24 # sum of 21 + 3 - - Constraints: - 1. 1 <= len(arr) <= 100 - 2. 1 <= k <= len(arr) - """ - -""" -Ek non-empty array of integers arr aur ek integer k diya gaya hai, pehle k elements mein se jinme maximum do digits hai unka sum return karo. - - Udaharan: - - Input: arr = [111,21,3,4000,5,6,7,8,9], k = 4 - Output: 24 # sum of 21 + 3 - - Constraints: - 1. 1 <= len(arr) <= 100 - 2. 1 <= k <= len(arr) -""" \ No newline at end of file diff --git a/translation/drafts/123 b/translation/drafts/123 deleted file mode 100644 index 5296e89f..00000000 --- a/translation/drafts/123 +++ /dev/null @@ -1,33 +0,0 @@ -""" - 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 - previous term as follows: if the previous term is even, the next term is one half of - the previous term. If the previous term is odd, the next term is 3 times the previous - term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1. - - Note: - 1. Collatz(1) is [1]. - 2. returned list sorted in increasing order. - - For example: - get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5. - """ - -""" -Diye gaye positive integer n ke liye, ek sorted list return karo jo collatz sequence mein odd numbers ko contain karti ho. - - Collatz conjecture ek mathematics ka conjecture hai jo ek sequence ke baare mein baat karta hai - jise is prakar se define kiya gaya hai: kisi bhi positive integer n se shuru karo. Phir har term ko - previous term se is prakar se prapt kiya jata hai: agar previous term even hai, toh next term - previous term ka aadha hota hai. Agar previous term odd hai, toh next term 3 guna previous - term plus 1 hota hai. Conjecture yeh hai ki chahe n ki value kuch bhi ho, sequence hamesha 1 tak pahunchegi. - - Note: - 1. Collatz(1) is [1]. - 2. returned list badhat kram mein sorted hoti hai. - - Jaise ki: - get_odd_collatz(5) returns [1, 5] # 5 ke liye collatz sequence [5, 16, 8, 4, 2, 1] hai, toh odd numbers sirf 1, aur 5 hai. -""" \ No newline at end of file diff --git a/translation/drafts/124 b/translation/drafts/124 deleted file mode 100644 index 98415730..00000000 --- a/translation/drafts/124 +++ /dev/null @@ -1,41 +0,0 @@ -"""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 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2. - 3. The months should not be less than 1 or higher than 12. - 4. The date should be in the format: mm-dd-yyyy - - for example: - valid_date('03-11-2000') => True - - valid_date('15-01-2012') => False - - valid_date('04-0-2040') => False - - valid_date('06-04-2020') => True - - valid_date('06/04/2020') => False - """ - -""" -Aapko ek function likhna hai jo diye gaye date string ko validate karta hai aur - agar date valid hai to True return karta hai, nahi to False. - Date tabhi valid hogi jab niche diye gaye saare rules satisfy ho: - 1. Date string khali nahi honi chahiye. - 2. Dinon ki sankhya 1 se kam ya 31 se adhik na ho mahino 1,3,5,7,8,10,12 ke liye. Aur dinon ki sankhya 1 se kam ya 30 se adhik na ho mahino 4,6,9,11 ke liye. Aur, dinon ki sankhya 1 se kam ya 29 se adhik na ho mahine 2 ke liye. - 3. Mahine ki sankhya 1 se kam ya 12 se adhik na ho. - 4. Date ka format aisa hona chahiye: mm-dd-yyyy - - jaise ki: - valid_date('03-11-2000') => True - - valid_date('15-01-2012') => False - - valid_date('04-0-2040') => False - - valid_date('06-04-2020') => True - - valid_date('06/04/2020') => False - -""" \ No newline at end of file diff --git a/translation/drafts/125 b/translation/drafts/125 deleted file mode 100644 index a4589cd9..00000000 --- a/translation/drafts/125 +++ /dev/null @@ -1,17 +0,0 @@ -""" - 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') = 0, ord('b') = 1, ... ord('z') = 25 - Examples - split_words("Hello world!") ➞ ["Hello", "world!"] - split_words("Hello,world!") ➞ ["Hello", "world!"] - split_words("abcdef") == 3 - """ - -""" -Ek string di gayi hai jisme words hain, aapko ek list return karni hai jisme words whitespace par split ho. Agar text me koi whitespace nahi hai toh aapko commas ',' par split karna hai. Agar koi comma bhi nahi hai toh aapko alphabet me odd order wale lower-case letters ki count return karni hai, jaise ki ord('a') = 0, ord('b') = 1, ... ord('z') = 25 - Udaharan - split_words("Hello world!") ➞ ["Hello", "world!"] - split_words("Hello,world!") ➞ ["Hello", "world!"] - split_words("abcdef") == 3 -""" \ No newline at end of file diff --git a/translation/drafts/126 b/translation/drafts/126 deleted file mode 100644 index 4fc513ad..00000000 --- a/translation/drafts/126 +++ /dev/null @@ -1,30 +0,0 @@ -""" - 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 - is_sorted([5]) ➞ True - is_sorted([1, 2, 3, 4, 5]) ➞ True - is_sorted([1, 3, 2, 4, 5]) ➞ False - is_sorted([1, 2, 3, 4, 5, 6]) ➞ True - is_sorted([1, 2, 3, 4, 5, 6, 7]) ➞ True - is_sorted([1, 3, 2, 4, 5, 6, 7]) ➞ False - is_sorted([1, 2, 2, 3, 3, 4]) ➞ True - is_sorted([1, 2, 2, 2, 3, 4]) ➞ False - """ - -""" -Ek numbers ki list di gayi hai, return karo ki kya ye ascending order mein sorted hai ya nahi. Agar list mein ek se jyada same number ke duplicate hain, to False return karo. Maan lo ki koi negative number nahi hai aur sirf integers hain. - -Udaharan -is_sorted([5]) ➞ True -is_sorted([1, 2, 3, 4, 5]) ➞ True -is_sorted([1, 3, 2, 4, 5]) ➞ False -is_sorted([1, 2, 3, 4, 5, 6]) ➞ True -is_sorted([1, 2, 3, 4, 5, 6, 7]) ➞ True -is_sorted([1, 3, 2, 4, 5, 6, 7]) ➞ False -is_sorted([1, 2, 2, 3, 3, 4]) ➞ True -is_sorted([1, 2, 2, 2, 3, 4]) ➞ False - -""" \ No newline at end of file diff --git a/translation/drafts/127 b/translation/drafts/127 deleted file mode 100644 index f2b30187..00000000 --- a/translation/drafts/127 +++ /dev/null @@ -1,40 +0,0 @@ -"""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 interval, it is assumed that its start is less or equal its end. - Your task is to determine whether the length of intersection of these two - intervals is a prime number. - Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3) - which its length is 1, which not a prime number. - If the length of the intersection is a prime number, return "YES", - otherwise, return "NO". - If the two intervals don't intersect, return "NO". - - - [input/output] samples: - intersection((1, 2), (2, 3)) ==> "NO" - intersection((-1, 1), (0, 4)) ==> "NO" - intersection((-3, -1), (-5, 5)) ==> "YES" - """ - -""" -Aapko do intervals diye gaye hain, - jahan har interval do integers ki jodi hoti hai. Jaise ki, interval = (start, end) = (1, 2). - Diye gaye intervals closed hote hain jiska matlab hai interval (start, end) - dono start aur end ko include karta hai. - Har diye gaye interval ke liye, maan liya jata hai ki uska start uske end se kam ya barabar hota hai. - Aapka task hai yeh determine karna ki in dono - intervals ke intersection ka length ek prime number hai ya nahi. - Udaharan, intervals (1, 3), (2, 4) ka intersection (2, 3) hota hai - jiska length 1 hota hai, jo ki ek prime number nahi hai. - Agar intersection ka length ek prime number hai, to "YES" return karo, - nahi to, "NO" return karo. - Agar do intervals intersect nahi karte, to "NO" return karo. - - - [input/output] samples: - intersection((1, 2), (2, 3)) ==> "NO" - intersection((-1, 1), (0, 4)) ==> "NO" - intersection((-3, -1), (-5, 5)) ==> "YES" -""" diff --git a/translation/drafts/128 b/translation/drafts/128 deleted file mode 100644 index 206c2e9b..00000000 --- a/translation/drafts/128 +++ /dev/null @@ -1,24 +0,0 @@ -""" - You are given an array arr of integers and you need to return - sum of magnitudes of integers multiplied by product of all signs - of each number in the array, represented by 1, -1 or 0. - Note: return None for empty arr. - - Example: - >>> prod_signs([1, 2, 2, -4]) == -9 - >>> prod_signs([0, 1]) == 0 - >>> prod_signs([]) == None - """ - -""" -Aapko ek array arr diya gaya hai integers ka aur aapko return karna hai - integers ke magnitudes ka sum jo multiplied hoga har number ke signs ka product se - jo array me diye gaye hain, jo ki 1, -1 ya 0 se represent kiya gaya hai. - Note: Agar arr khali hai to None return karo. - - Udaharan: - >>> prod_signs([1, 2, 2, -4]) == -9 - >>> prod_signs([0, 1]) == 0 - >>> prod_signs([]) == None - -""" \ No newline at end of file diff --git a/translation/drafts/129 b/translation/drafts/129 deleted file mode 100644 index c9855287..00000000 --- a/translation/drafts/129 +++ /dev/null @@ -1,57 +0,0 @@ -""" - 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 of length k in the grid. You can start - from any cell, and in each step you can move to any of the neighbor cells, - in other words, you can go to cells which share an edge with you current - cell. - Please note that a path of length k means visiting exactly k cells (not - necessarily distinct). - You CANNOT go off the grid. - A path A (of length k) is considered less than a path B (of length k) if - after making the ordered lists of the values on the cells that A and B go - through (let's call them lst_A and lst_B), lst_A is lexicographically less - than lst_B, in other words, there exist an integer index i (1 <= i <= k) - such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have - lst_A[j] = lst_B[j]. - It is guaranteed that the answer is unique. - Return an ordered list of the values on the cells that the minimum path go through. - - Examples: - - Input: grid = [ [1,2,3], [4,5,6], [7,8,9]], k = 3 - Output: [1, 2, 1] - - Input: grid = [ [5,9,3], [4,1,6], [7,8,2]], k = 1 - Output: [1] - """ - -""" -Ek grid di gayi hai N rows aur N columns ke saath (N >= 2) aur ek positive integer k, - grid ke har cell me ek value hai. Har integer range [1, N * N] - inclusive grid ke cells par exactly ek baar appear hota hai. - - Aapko grid me length k ki minimum path find karni hai. Aap kisi bhi cell se start - kar sakte ho, aur har step me aap kisi bhi neighbor cell me move kar sakte ho, - dusre shabdo me, aap un cells me ja sakte ho jo aapke current - cell se edge share karte hain. - Dhyan dijiye ki length k ki path ka matlab hai exactly k cells visit karna (not - necessarily distinct). - Aap grid ke bahar nahi ja sakte. - Ek path A (length k ki) ko path B (length k ki) se kam maana jata hai agar - cells par jin values ko A aur B go through karte hain unki ordered lists banane ke baad (unhe hum lst_A aur lst_B kehte hain), lst_A lst_B se lexicographically kam hota hai, dusre shabdo me, ek integer index i exist karta hai (1 <= i <= k) - jahan lst_A[i] < lst_B[i] aur kisi bhi j (1 <= j < i) ke liye hum - lst_A[j] = lst_B[j] rakhte hain. - Yeh guarantee ki gayi hai ki answer unique hoga. - Return karo ek ordered list of the values jin cells se minimum path go through karti hai. - - Examples: - - Input: grid = [ [1,2,3], [4,5,6], [7,8,9]], k = 3 - Output: [1, 2, 1] - - Input: grid = [ [5,9,3], [4,1,6], [7,8,2]], k = 1 - Output: [1] -""" \ No newline at end of file diff --git a/translation/drafts/13 b/translation/drafts/13 deleted file mode 100644 index 9feb3021..00000000 --- a/translation/drafts/13 +++ /dev/null @@ -1,14 +0,0 @@ -""" Return a greatest common divisor of two integers a and b - >>> greatest_common_divisor(3, 5) - 1 - >>> greatest_common_divisor(25, 15) - 5 - """ - -""" -Do integers a aur b ke greatest common divisor ko return karo - >>> greatest_common_divisor(3, 5) - 1 - >>> greatest_common_divisor(25, 15) - 5 -""" \ No newline at end of file diff --git a/translation/drafts/130 b/translation/drafts/130 deleted file mode 100644 index 472f2523..00000000 --- a/translation/drafts/130 +++ /dev/null @@ -1,34 +0,0 @@ -"""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) = 3 - tri(n) = 1 + n / 2, if n is even. - tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd. - For example: - tri(2) = 1 + (2 / 2) = 2 - tri(4) = 3 - tri(3) = tri(2) + tri(1) + tri(4) - = 2 + 3 + 3 = 8 - You are given a non-negative integer number n, you have to a return a list of the - first n + 1 numbers of the Tribonacci sequence. - Examples: - tri(3) = [1, 3, 2, 8] - """ - -""" -Sabhi ko Fibonacci sequence ke baare mein pata hai, yeh mathematicians -ne pichle kuch sadiyon mein gahrai se adhyayan kiya. Lekin, jo log nahi jaante -woh hai Tribonacci sequence. - Tribonacci sequence ko define kiya gaya hai recurrence ke dwara: - tri(1) = 3 - tri(n) = 1 + n / 2, agar n even hai. - tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), agar n odd hai. - Jaise ki: - tri(2) = 1 + (2 / 2) = 2 - tri(4) = 3 - tri(3) = tri(2) + tri(1) + tri(4) - = 2 + 3 + 3 = 8 - Aapko ek non-negative integer number n diya jayega, aapko Tribonacci sequence ke pehle n + 1 numbers ka ek list return karna hai. - Examples: - tri(3) = [1, 3, 2, 8] -""" diff --git a/translation/drafts/131 b/translation/drafts/131 deleted file mode 100644 index 6a8075cf..00000000 --- a/translation/drafts/131 +++ /dev/null @@ -1,16 +0,0 @@ -"""Given a positive integer n, return the product of the odd digits. - Return 0 if all digits are even. - For example: - digits(1) == 1 - digits(4) == 0 - digits(235) == 15 - """ - -""" -Ek positive integer n diya gaya hai, odd digits ka product return karo. - Agar saare digits even hain to 0 return karo. - Udaharan ke liye: - digits(1) == 1 - digits(4) == 0 - digits(235) == 15 -""" \ No newline at end of file diff --git a/translation/drafts/132 b/translation/drafts/132 deleted file mode 100644 index 848dfd42..00000000 --- a/translation/drafts/132 +++ /dev/null @@ -1,26 +0,0 @@ -""" - Create a function that takes a string as input which contains only square brackets. - The function should return True if and only if there is a valid subsequence of brackets - where at least one bracket in the subsequence is nested. - - is_nested('[[]]') ➞ True - is_nested('[]]]]]]][[[[[]') ➞ False - is_nested('[][]') ➞ False - is_nested('[]') ➞ False - is_nested('[[][]]') ➞ True - is_nested('[[]][[') ➞ True - """ - -""" -Ek function banao jo sirf square brackets wala string input ke roop mein leta hai. - Function tabhi True return karega jab valid subsequence of brackets ho - jisme kam se kam ek bracket nested ho. - - is_nested('[[]]') ➞ True - is_nested('[]]]]]]][[[[[]') ➞ False - is_nested('[][]') ➞ False - is_nested('[]') ➞ False - is_nested('[[][]]') ➞ True - is_nested('[[]][[') ➞ True - -""" \ No newline at end of file diff --git a/translation/drafts/133 b/translation/drafts/133 deleted file mode 100644 index 2be62482..00000000 --- a/translation/drafts/133 +++ /dev/null @@ -1,25 +0,0 @@ -"""You are given a list of numbers. - You need to return the sum of squared numbers in the given list, - round each element in the list to the upper int(Ceiling) first. - Examples: - For lst = [1,2,3] the output should be 14 - For lst = [1,4,9] the output should be 98 - For lst = [1,3,5,7] the output should be 84 - For lst = [1.4,4.2,0] the output should be 29 - For lst = [-2.4,1,1] the output should be 6 - - - """ - -""" -Aapko ek numbers ki list di gayi hai. - Aapko di gayi list ke squared numbers ka sum return karna hai, - pehle har element ko list mein upper int(Ceiling) par round karo. - Udaharan: - Agar lst = [1,2,3] hai to output hona chahiye 14 - Agar lst = [1,4,9] hai to output hona chahiye 98 - Agar lst = [1,3,5,7] hai to output hona chahiye 84 - Agar lst = [1.4,4.2,0] hai to output hona chahiye 29 - Agar lst = [-2.4,1,1] hai to output hona chahiye 6 - -""" \ No newline at end of file diff --git a/translation/drafts/134 b/translation/drafts/134 deleted file mode 100644 index 6bdadebf..00000000 --- a/translation/drafts/134 +++ /dev/null @@ -1,21 +0,0 @@ -""" - 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 not separated by space. - - Examples: - check_if_last_char_is_a_letter("apple pie") ➞ False - check_if_last_char_is_a_letter("apple pi e") ➞ True - check_if_last_char_is_a_letter("") ➞ False - """ - -""" -Ek function banaiye jo True return kare agar diye gaye string ka last character ek alphabetical character ho aur wo kisi word ka hissa na ho, anyatha False return kare. - Dhyan de: "word" ek characters ka group hota hai jo space se alag na ho. - - Udaharan: - check_if_last_char_is_a_letter("apple pie") ➞ False - check_if_last_char_is_a_letter("apple pi e") ➞ True - check_if_last_char_is_a_letter("") ➞ False -""" \ No newline at end of file diff --git a/translation/drafts/135 b/translation/drafts/135 deleted file mode 100644 index 3e05a77e..00000000 --- a/translation/drafts/135 +++ /dev/null @@ -1,22 +0,0 @@ -"""Create a function which returns the largest index of an element which - is not greater than or equal to the element immediately preceding it. If - no such element exists then return -1. The given array will not contain - duplicate values. - - Examples: - can_arrange([1,2,4,3,5]) = 3 - can_arrange([1,2,3]) = -1 - -""" - -""" -Ek function banaiye jo ek element ka sabse bada index return kare jo - usse turant pichle element se bada ya barabar nahi ho. Agar - aisa koi element nahi hai, to -1 return kare. Diye gaye array me - duplicate values nahi hogi. - - Udaharan: - can_arrange([1,2,4,3,5]) = 3 - can_arrange([1,2,3]) = -1 - -""" \ No newline at end of file diff --git a/translation/drafts/136 b/translation/drafts/136 deleted file mode 100644 index 476cfbef..00000000 --- a/translation/drafts/136 +++ /dev/null @@ -1,21 +0,0 @@ -""" - 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 None. - - Examples: - largest_smallest_integers([2, 4, 1, 3, 5, 7]) == (None, 1) - largest_smallest_integers([]) == (None, None) - largest_smallest_integers([0]) == (None, None) - """ - -""" -Ek function banao jo ek tuple (a, b) return kare, jahan 'a' negative integers ka sabse bada hai, aur 'b' positive integers ka sabse chota hai list mein. - Agar koi negative ya positive integers nahi hai, to None return karo. - - Udaharan: - largest_smallest_integers([2, 4, 1, 3, 5, 7]) == (None, 1) - largest_smallest_integers([]) == (None, None) - largest_smallest_integers([0]) == (None, None) -""" \ No newline at end of file diff --git a/translation/drafts/137 b/translation/drafts/137 deleted file mode 100644 index a23312fa..00000000 --- a/translation/drafts/137 +++ /dev/null @@ -1,22 +0,0 @@ -""" - Create a function that takes integers, floats, or strings representing - real numbers, and returns the larger variable in its given variable type. - Return None if the values are equal. - Note: If a real number is represented as a string, the floating point might be . or , - - compare_one(1, 2.5) ➞ 2.5 - compare_one(1, "2,3") ➞ "2,3" - compare_one("5,1", "6") ➞ "6" - compare_one("1", 1) ➞ None - """ - -""" -Ek function banao jo integers, floats, ya real numbers ko represent karne waale strings leta hai aur usme se bada variable uske diye gaye variable type mein return karta hai. - Agar values equal hain to None return karo. - Dhyan do: Agar ek real number ko string ke form mein diya hai, to floating point . ya , ho sakta hai. - - compare_one(1, 2.5) ➞ 2.5 - compare_one(1, "2,3") ➞ "2,3" - compare_one("5,1", "6") ➞ "6" - compare_one("1", 1) ➞ None -""" \ No newline at end of file diff --git a/translation/drafts/138 b/translation/drafts/138 deleted file mode 100644 index 5edc0581..00000000 --- a/translation/drafts/138 +++ /dev/null @@ -1,15 +0,0 @@ -"""Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers - Example - is_equal_to_sum_even(4) == False - is_equal_to_sum_even(6) == False - is_equal_to_sum_even(8) == True - """ - -""" -Evaluate karo ki diya gaya number n kya exactly 4 positive even numbers ka sum ho sakta hai - Udaharan - is_equal_to_sum_even(4) == False - is_equal_to_sum_even(6) == False - is_equal_to_sum_even(8) == True - -""" \ No newline at end of file diff --git a/translation/drafts/139 b/translation/drafts/139 deleted file mode 100644 index a2ec991e..00000000 --- a/translation/drafts/139 +++ /dev/null @@ -1,23 +0,0 @@ -"""The Brazilian factorial is defined as: - brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1! - where n > 0 - - For example: - >>> special_factorial(4) - 288 - - The function will receive an integer as input and should return the special - factorial of this integer. - """ - -""" -Brazilian factorial aise define kiya gaya hai: - brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1! - jaha n > 0 - - Jaise ki: - >>> special_factorial(4) - 288 - - Ye function ek integer input lega aur is integer ka special factorial return karega. -""" \ No newline at end of file diff --git a/translation/drafts/14 b/translation/drafts/14 deleted file mode 100644 index fa8c0089..00000000 --- a/translation/drafts/14 +++ /dev/null @@ -1,10 +0,0 @@ -""" Return list of all prefixes from shortest to longest of the input string - >>> all_prefixes('abc') - ['a', 'ab', 'abc'] - """ - -""" -Input string ke sabhi prefixes ko shortest se longest tak, list mei return karo - >>> all_prefixes('abc') - ['a', 'ab', 'abc'] -""" diff --git a/translation/drafts/140 b/translation/drafts/140 deleted file mode 100644 index 25677ddc..00000000 --- a/translation/drafts/140 +++ /dev/null @@ -1,21 +0,0 @@ -""" - Given a string text, replace all spaces in it with underscores, - and if a string has more than 2 consecutive spaces, - then replace all consecutive spaces with - - - fix_spaces("Example") == "Example" - fix_spaces("Example 1") == "Example_1" - fix_spaces(" Example 2") == "_Example_2" - fix_spaces(" Example 3") == "_Example-3" - """ - -""" -Diye gaye string text mein, saare spaces ko underscores se replace karo, - aur agar ek string mein 2 se zyada consecutive spaces ho, - toh saare consecutive spaces ko - se replace karo. - - fix_spaces("Example") == "Example" - fix_spaces("Example 1") == "Example_1" - fix_spaces(" Example 2") == "_Example_2" - fix_spaces(" Example 3") == "_Example-3" -""" diff --git a/translation/drafts/141 b/translation/drafts/141 deleted file mode 100644 index 1df694c8..00000000 --- a/translation/drafts/141 +++ /dev/null @@ -1,26 +0,0 @@ -"""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 than three digits ('0'-'9') in the file's name. - - The file's name contains exactly one dot '.' - - The substring before the dot should not be empty, and it starts with a letter from - the latin alphapet ('a'-'z' and 'A'-'Z'). - - The substring after the dot should be one of these: ['txt', 'exe', 'dll'] - Examples: - file_name_check("example.txt") # => 'Yes' - file_name_check("1example.dll") # => 'No' (the name should start with a latin alphapet letter) - """ - -""" -Ek function banao jo ek string leta hai jisme file ka naam hota hai, aur return karta hai - 'Yes' agar file ka naam valid hai, aur 'No' agar nahi. - Ek file ka naam tabhi maana jayega jab saare neeche diye gaye conditions meet ho: - - File ke naam me teen se zyada digits ('0'-'9') nahi hone chahiye. - - File ke naam me sirf ek dot '.' hona chahiye. - - Dot se pehle ka substring khali nahi hona chahiye, aur uska shuruat latin alphabet ('a'-'z' aur 'A'-'Z') se hona chahiye. - - Dot ke baad ka substring inme se ek hona chahiye: ['txt', 'exe', 'dll'] - Examples: - file_name_check("example.txt") # => 'Yes' - file_name_check("1example.dll") # => 'No' (naam latin alphabet letter se shuru hona chahiye) -""" diff --git a/translation/drafts/142 b/translation/drafts/142 deleted file mode 100644 index 0d320ca0..00000000 --- a/translation/drafts/142 +++ /dev/null @@ -1,23 +0,0 @@ -"""" - This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a - multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not - change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. - - Examples: - For lst = [1,2,3] the output should be 6 - For lst = [] the output should be 0 - For lst = [-1,-5,2,-1,-5] the output should be -126 - """ - -""" -" - Ye function ek integers ki list lega. List ke saare entries ke liye, function integer entry ko square karega agar uska index 3 ka - multiple hai aur cube karega agar uska index 4 ka multiple hai aur 3 ka multiple nahi hai. Function un entries ko change nahi - karega jinki indexes 3 ya 4 ka multiple nahi hai. Phir function saare entries ka sum return karega. - - Examples: - Agar lst = [1,2,3] hai to output 6 hona chahiye - Agar lst = [] hai to output 0 hona chahiye - Agar lst = [-1,-5,2,-1,-5] hai to output -126 hona chahiye - -""" diff --git a/translation/drafts/143 b/translation/drafts/143 deleted file mode 100644 index 6572d979..00000000 --- a/translation/drafts/143 +++ /dev/null @@ -1,40 +0,0 @@ -""" - 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 be the same as the original one. - - Example 1: - Input: sentence = "This is a test" - Output: "is" - - Example 2: - Input: sentence = "lets go for swimming" - Output: "go for" - - Constraints: - * 1 <= len(sentence) <= 100 - * sentence contains only letters - """ - -""" -Aapko ek string di gayi hai jo ek sentence ko represent karti hai, - sentence mein kuch words hote hain jo space se separated hote hain, - aur aapko ek string return karni hai jo original sentence ke un words ko contain karti hai, - jinki lengths prime numbers hain, - nayi string mein words ka order di gayi string ke jaisa hona chahiye. - - Udaaharan 1: - Input: sentence = "This is a test" - Output: "is" - - Udaaharan 2: - Input: sentence = "lets go for swimming" - Output: "go for" - - Constraints: - * 1 <= len(sentence) <= 100 - * sentence sirf letters contain karti hai - -""" \ No newline at end of file diff --git a/translation/drafts/144 b/translation/drafts/144 deleted file mode 100644 index e4063a9a..00000000 --- a/translation/drafts/144 +++ /dev/null @@ -1,24 +0,0 @@ -"""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, - / where both numerator and denominator are positive whole numbers. - - You can assume that x, and n are valid fractions, and do not have zero as denominator. - - simplify("1/5", "5/1") = True - simplify("1/6", "2/1") = False - simplify("7/10", "10/2") = False - """ - -""" -Aapka task hai ek function implement karna jo expression - x * n ko simplify karega. Yeh function True return karega agar x * n ka evaluation ek whole number hota hai aur False - otherwise. Dono x aur n, fraction ka string representation hai, aur inka format aisa hota hai, - / jahan dono numerator aur denominator positive whole numbers hote hain. - - Aap maan sakte hain ki x, aur n valid fractions hain, aur inka denominator zero nahi hota. - - simplify("1/5", "5/1") = True - simplify("1/6", "2/1") = False - simplify("7/10", "10/2") = False -""" diff --git a/translation/drafts/145 b/translation/drafts/145 deleted file mode 100644 index 68789de2..00000000 --- a/translation/drafts/145 +++ /dev/null @@ -1,20 +0,0 @@ -""" - 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. - - For example: - >>> order_by_points([1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11] - >>> order_by_points([]) == [] - """ - -""" -Ek function likho jo diye gaye integers ki list ko unke digits ka sum ke hisaab se ascending order mein sort kare. - Dhyan do: agar kuch items ke digits ka sum similar ho, - toh unhe original list ke index ke basis par order karo. - - Jaise ki: - >>> order_by_points([1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11] - >>> order_by_points([]) == [] -""" diff --git a/translation/drafts/146 b/translation/drafts/146 deleted file mode 100644 index f7214cec..00000000 --- a/translation/drafts/146 +++ /dev/null @@ -1,16 +0,0 @@ -"""Write a function that takes an array of numbers as input and returns - the number of elements in the array that are greater than 10 and both - first and last digits of a number are odd (1, 3, 5, 7, 9). - For example: - specialFilter([15, -73, 14, -15]) => 1 - specialFilter([33, -2, -3, 45, 21, 109]) => 2 - """ - -""" -Ek function likho jo numbers ki array ko input ke roop mein leta hai aur return karta hai - array ke kitne elements 10 se bade hai aur jinke - pehla aur aakhri digit dono odd hai (1, 3, 5, 7, 9). - Jaise ki: - specialFilter([15, -73, 14, -15]) => 1 - specialFilter([33, -2, -3, 45, 21, 109]) => 2 -""" \ No newline at end of file diff --git a/translation/drafts/147 b/translation/drafts/147 deleted file mode 100644 index 2852d45c..00000000 --- a/translation/drafts/147 +++ /dev/null @@ -1,27 +0,0 @@ -""" - You are given a positive integer n. You have to create an integer array a of length n. - For each i (1 ≤ i ≤ n), the value of a[i] = i * i - i + 1. - Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, - and a[i] + a[j] + a[k] is a multiple of 3. - - Example : - Input: n = 5 - Output: 1 - Explanation: - a = [1, 3, 7, 13, 21] - The only valid triple is (1, 7, 13). - """ - -""" -Aapko ek positive integer n diya gaya hai. Aapko ek integer array a banani hai jiski length n ho. - Har i (1 ≤ i ≤ n) ke liye, a[i] ka value hoga i * i - i + 1. - Return karo triples (a[i], a[j], a[k]) ka number jahan a[i] + a[j] + a[k] 3 ka multiple ho aur i < j < k ho. - - Udaharan : - Input: n = 5 - Output: 1 - Explanation: - a = [1, 3, 7, 13, 21] - Sirf ek valid triple hai (1, 7, 13). - -""" diff --git a/translation/drafts/148 b/translation/drafts/148 deleted file mode 100644 index d5e962cc..00000000 --- a/translation/drafts/148 +++ /dev/null @@ -1,26 +0,0 @@ -""" - 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 tuple containing all planets whose orbits are - located between the orbit of planet1 and the orbit of planet2, sorted by - the proximity to the sun. - The function should return an empty tuple if planet1 or planet2 - are not correct planet names. - Examples - bf("Jupiter", "Neptune") ==> ("Saturn", "Uranus") - bf("Earth", "Mercury") ==> ("Venus") - bf("Mercury", "Uranus") ==> ("Venus", "Earth", "Mars", "Jupiter", "Saturn") - """ - -""" -Hamare solar system mein aath grah hain: sabse paas Suraj ke Mercury hai, uske baad Venus, phir Earth, Mars, Jupiter, Saturn, Uranus, Neptune. -Ek function likho jo do grahon ke naam planet1 aur planet2 ko strings ke roop mein leta hai. -Function ko ek tuple return karna chahiye jisme saare grah hain jinke orbits planet1 aur planet2 ke orbit ke beech mein hote hain, Suraj ke nazdeek hone ke hisaab se sort kiye gaye. -Agar planet1 ya planet2 sahi grah ke naam nahi hain to function ko ek khali tuple return karna chahiye. -Udaharan -bf("Jupiter", "Neptune") ==> ("Saturn", "Uranus") -bf("Earth", "Mercury") ==> ("Venus") -bf("Mercury", "Uranus") ==> ("Venus", "Earth", "Mars", "Jupiter", "Saturn") -""" diff --git a/translation/drafts/149 b/translation/drafts/149 deleted file mode 100644 index f041a157..00000000 --- a/translation/drafts/149 +++ /dev/null @@ -1,30 +0,0 @@ -"""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 duplicates. - The order of the list should be ascending by length of each word, and you - should return the list sorted by that rule. - If two words have the same length, sort the list alphabetically. - The function should return a list of strings in sorted order. - You may assume that all words will have the same length. - For example: - assert list_sort(["aa", "a", "aaa"]) => ["aa"] - assert list_sort(["ab", "a", "aaa", "cd"]) => ["ab", "cd"] - """ - -""" -Ek function likho jo strings ki list ko parameter mein accept karta hai, - usme se odd lengths wale strings ko delete karta hai, - aur resulted list ko sorted order mein return karta hai, - List hamesha strings ki list hoti hai aur kabhi numbers ki array nahi hoti, - aur usme duplicates ho sakte hain. - List ka order har word ki length ke hisaab se ascending hona chahiye, aur aapko - us rule ke hisaab se sorted list ko return karna chahiye. - Agar do words ki length same ho, to list ko alphabetically sort karo. - Function ko sorted order mein strings ki list return karni chahiye. - Aap maan sakte ho ki sabhi words ki length baraabar hogi. - Jaise ki: - assert list_sort(["aa", "a", "aaa"]) => ["aa"] - assert list_sort(["ab", "a", "aaa", "cd"]) => ["ab", "cd"] -""" \ No newline at end of file diff --git a/translation/drafts/15 b/translation/drafts/15 deleted file mode 100644 index 8df2f5ba..00000000 --- a/translation/drafts/15 +++ /dev/null @@ -1,14 +0,0 @@ -""" Return a string containing space-delimited numbers starting from 0 upto n inclusive. - >>> string_sequence(0) - '0' - >>> string_sequence(5) - '0 1 2 3 4 5' - """ - -""" -Ek string return karo jisme 0 se lekar n tak ke numbers space-delimited honge. - >>> string_sequence(0) - '0' - >>> string_sequence(5) - '0 1 2 3 4 5' -""" \ No newline at end of file diff --git a/translation/drafts/150 b/translation/drafts/150 deleted file mode 100644 index 3ecf2199..00000000 --- a/translation/drafts/150 +++ /dev/null @@ -1,17 +0,0 @@ -"""A simple program which should return the value of x if n is - a prime number and should return the value of y otherwise. - - Examples: - for x_or_y(7, 34, 12) == 34 - for x_or_y(15, 8, 5) == 5 - - """ - -""" -Ek simple program jo n ek prime number hone par x ka value return karega aur anyatha y ka value return karega. - - Udaharan: - for x_or_y(7, 34, 12) == 34 - for x_or_y(15, 8, 5) == 5 - -""" diff --git a/translation/drafts/151 b/translation/drafts/151 deleted file mode 100644 index ed553239..00000000 --- a/translation/drafts/151 +++ /dev/null @@ -1,23 +0,0 @@ -""" - Given a list of numbers, return the sum of squares of the numbers - in the list that are odd. Ignore numbers that are negative or not integers. - - double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10 - double_the_difference([-1, -2, 0]) == 0 - double_the_difference([9, -2]) == 81 - double_the_difference([0]) == 0 - - If the input list is empty, return 0. - """ - -""" -Diye gaye numbers ki list mein se, odd numbers ke squares ka sum return karo. - Negative ya non-integer numbers ko ignore karo. - - double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10 - double_the_difference([-1, -2, 0]) == 0 - double_the_difference([9, -2]) == 81 - double_the_difference([0]) == 0 - - Agar input list khali ho, to 0 return karo. -""" diff --git a/translation/drafts/152 b/translation/drafts/152 deleted file mode 100644 index 6f87121e..00000000 --- a/translation/drafts/152 +++ /dev/null @@ -1,28 +0,0 @@ -"""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 the results of a number of matches. - You are given two arrays of scores and guesses of equal length, where each index shows a match. - Return an array of the same length denoting how far off each guess was. If they have guessed correctly, - the value is 0, and if not, the value is the absolute difference between the guess and the score. - - - example: - - compare([1,2,3,4,5,1],[1,2,3,4,2,-2]) -> [0,0,0,0,3,3] - compare([0,5,0,0,0,4],[4,1,1,0,0,-2]) -> [4,4,1,0,0,6] - """ - -""" -Mujhe lagta hai hum sabko woh ehsaas yaad hoga jab kisi besabri se intezaar karne wale event ka result finally pata chalta hai. Us samay jo aapke feelings aur vichar hote hain, unhe note down karna aur compare karna zaroori hota hai. - Aapka task hai yeh determine karna ki kya ek vyakti ne kisi matches ke results ko sahi tara se guess kiya hai ya nahi. - Aapko do arrays diye jayenge scores aur guesses ke, jinka length equal hoga, jahan har index ek match ko dikhata hai. - Wapas ek array return karo jiska length same ho, jo denote karta hai ki har guess kitna off tha. Agar unhone sahi guess kiya hai, - toh value 0 hogi, aur agar nahi, toh value guess aur score ke beech ka absolute difference hoga. - - - Udaharan: - - compare([1,2,3,4,5,1],[1,2,3,4,2,-2]) -> [0,0,0,0,3,3] - compare([0,5,0,0,0,4],[4,1,1,0,0,-2]) -> [4,4,1,0,0,6] -""" diff --git a/translation/drafts/153 b/translation/drafts/153 deleted file mode 100644 index be10b731..00000000 --- a/translation/drafts/153 +++ /dev/null @@ -1,34 +0,0 @@ -"""You will be given the name of a class (a string) and a list of extensions. - The extensions are to be used to load additional classes to the class. The - strength of the extension is as follows: Let CAP be the number of the uppercase - letters in the extension's name, and let SM be the number of lowercase letters - in the extension's name, the strength is given by the fraction CAP - SM. - You should find the strongest extension and return a string in this - format: ClassName.StrongestExtensionName. - If there are two or more extensions with the same strength, you should - choose the one that comes first in the list. - For example, if you are given "Slices" as the class and a list of the - extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should - return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension - (its strength is -1). - Example: - for Strongest_Extension('my_class', ['AA', 'Be', 'CC']) == 'my_class.AA' - """ - -""" -Aapko ek class ka naam (ek string) aur ek extensions ki list di jayegi. - Extensions ko additional classes ko class me load karne ke liye use kiya jata hai. Extension ki - strength is prakar hai: Maan lijiye number CAP, extension ke naam me uppercase - letters ki sankhya hai, aur number SM, extension ke naam me lowercase letters - ki sankhya hai, strength ka nirdharan CAP - SM ke fraction se hota hai. - Aapko sabse strong extension dhundhni hai aur is - format me ek string return karni hai: ClassName.StrongestExtensionName. - Agar do ya do se zyada extensions ki strength same ho, to aapko - list me sabse pehle aane wale extension ko chunna chahiye. - Udaharan ke liye, agar aapko "Slices" class aur extensions ki list: ['SErviNGSliCes', 'Cheese', 'StuFfed'] - di gayi hai to aapko 'Slices.SErviNGSliCes' return karna chahiye kyunki 'SErviNGSliCes' sabse strong extension - hai (iska strength -1 hai). - Udaharan: - for Strongest_Extension('my_class', ['AA', 'Be', 'CC']) == 'my_class.AA' - -""" diff --git a/translation/drafts/154 b/translation/drafts/154 deleted file mode 100644 index ef54d87d..00000000 --- a/translation/drafts/154 +++ /dev/null @@ -1,20 +0,0 @@ -"""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 - cycpattern_check("abcd","abd") => False - cycpattern_check("hello","ell") => True - cycpattern_check("whassup","psus") => False - cycpattern_check("abab","baa") => True - cycpattern_check("efef","eeff") => False - cycpattern_check("himenss","simen") => True - - """ - -""" -Aapko 2 words diye gaye hain. Aapko True return karna hai agar dusra word ya uske kisi bhi rotation ko pehle word ke substring mein milta hai - cycpattern_check("abcd","abd") => False - cycpattern_check("hello","ell") => True - cycpattern_check("whassup","psus") => False - cycpattern_check("abab","baa") => True - cycpattern_check("efef","eeff") => False - cycpattern_check("himenss","simen") => True - -""" \ No newline at end of file diff --git a/translation/drafts/155 b/translation/drafts/155 deleted file mode 100644 index d8e24ccc..00000000 --- a/translation/drafts/155 +++ /dev/null @@ -1,14 +0,0 @@ -"""Given an integer. return a tuple that has the number of even and odd digits respectively. - - Example: - even_odd_count(-12) ==> (1, 1) - even_odd_count(123) ==> (1, 2) - """ - -""" -Ek integer diya gaya hai. Ek tuple return karo jo even aur odd digits ki sankhya ko kramashah darshata hai. - - Udaharan: - even_odd_count(-12) ==> (1, 1) - even_odd_count(123) ==> (1, 2) -""" \ No newline at end of file diff --git a/translation/drafts/156 b/translation/drafts/156 deleted file mode 100644 index ba722799..00000000 --- a/translation/drafts/156 +++ /dev/null @@ -1,21 +0,0 @@ -""" - Given a positive integer, obtain its roman numeral equivalent as a string, - and return it in lowercase. - Restrictions: 1 <= num <= 1000 - - Examples: - >>> int_to_mini_roman(19) == 'xix' - >>> int_to_mini_roman(152) == 'clii' - >>> int_to_mini_roman(426) == 'cdxxvi' - """ - -""" -Diye gaye positive integer ko uska roman numeral equivalent ke roop mein, string ke roop mein return karo, - aur ise lowercase mein return karo. - Restrictions: 1 <= num <= 1000 - - Udaharan: - >>> int_to_mini_roman(19) == 'xix' - >>> int_to_mini_roman(152) == 'clii' - >>> int_to_mini_roman(426) == 'cdxxvi' -""" diff --git a/translation/drafts/157 b/translation/drafts/157 deleted file mode 100644 index 769165c3..00000000 --- a/translation/drafts/157 +++ /dev/null @@ -1,17 +0,0 @@ -""" - 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. - Example: - right_angle_triangle(3, 4, 5) == True - right_angle_triangle(1, 2, 3) == False - """ - -""" -Trikon ke teeno sides ke lengths diye gaye hain. Agar ye teen sides ek samkon trikon banate hain to True return karo, nahi to False. - Ek samkon trikon woh hota hai jisme ek kon samkon ya 90 degree hota hai. - Udaharan: - right_angle_triangle(3, 4, 5) == True - right_angle_triangle(1, 2, 3) == False -""" \ No newline at end of file diff --git a/translation/drafts/158 b/translation/drafts/158 deleted file mode 100644 index 065ae754..00000000 --- a/translation/drafts/158 +++ /dev/null @@ -1,18 +0,0 @@ -"""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. - - find_max(["name", "of", "string"]) == "string" - find_max(["name", "enam", "game"]) == "enam" - find_max(["aaaaaaa", "bb" ,"cc"]) == ""aaaaaaa" - """ - -""" -Ek function likho jo strings ki ek list accept karta hai. - List mein alag alag words hain. Sabse zyada unique characters wala word return karo. Agar multiple strings mein maximum number of unique characters ho, toh lexicographical order mein sabse pehle aane wala word return karo. - - find_max(["name", "of", "string"]) == "string" - find_max(["name", "enam", "game"]) == "enam" - find_max(["aaaaaaa", "bb" ,"cc"]) == "aaaaaaa" -""" diff --git a/translation/drafts/159 b/translation/drafts/159 deleted file mode 100644 index 3a421fdd..00000000 --- a/translation/drafts/159 +++ /dev/null @@ -1,57 +0,0 @@ -""" - 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 after your meals ] - if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry. - - Example: - * eat(5, 6, 10) -> [11, 4] - * eat(4, 8, 9) -> [12, 1] - * eat(1, 10, 10) -> [11, 0] - * eat(2, 11, 5) -> [7, 0] - - Variables: - @number : integer - the number of carrots that you have eaten. - @need : integer - the number of carrots that you need to eat. - @remaining : integer - the number of remaining carrots thet exist in stock - - Constrain: - * 0 <= number <= 1000 - * 0 <= need <= 1000 - * 0 <= remaining <= 1000 - - Have fun :) - """ - -""" -Tum ek bhukha khargosh ho, aur tumne pehle hi kuch gajar kha liye hain, - lekin ab tumhe din bhar ke bhojan ko pura karne ke liye aur gajar khane ki zarurat hai. - tumhe ek array return karna chahiye jisme [ tumhare bhojan ke baad khaye gaye total gajar, - bhojan ke baad bache hue gajar ] ho. - Agar bache hue gajar kafi na ho, to tum saare bache hue gajar kha loge, lekin phir bhi bhukha rahoge. - - Udaharan: - * eat(5, 6, 10) -> [11, 4] - * eat(4, 8, 9) -> [12, 1] - * eat(1, 10, 10) -> [11, 0] - * eat(2, 11, 5) -> [7, 0] - - Variables: - @number : integer - gajar jo tumne pehle kha li hain. - @need : integer - gajar jo tumhe ab khane ki zarurat hai. - @remaining : integer - stock mein bache hue gajar ki sankhya - - Constrain: - * 0 <= number <= 1000 - * 0 <= need <= 1000 - * 0 <= remaining <= 1000 - - Maza karo :) -""" \ No newline at end of file diff --git a/translation/drafts/16 b/translation/drafts/16 deleted file mode 100644 index 41cf72f1..00000000 --- a/translation/drafts/16 +++ /dev/null @@ -1,14 +0,0 @@ -""" Given a string, find out how many distinct characters (regardless of case) does it consist of - >>> count_distinct_characters('xyzXYZ') - 3 - >>> count_distinct_characters('Jerry') - 4 - """ - -""" -Ek string di gayi hai, pata karo ki usme kitne alag-alag characters (case ki parwah kiye bina) hain - >>> count_distinct_characters('xyzXYZ') - 3 - >>> count_distinct_characters('Jerry') - 4 -""" \ No newline at end of file diff --git a/translation/drafts/160 b/translation/drafts/160 deleted file mode 100644 index bc7e5721..00000000 --- a/translation/drafts/160 +++ /dev/null @@ -1,49 +0,0 @@ -""" - 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 operations: - Addition ( + ) - Subtraction ( - ) - Multiplication ( * ) - Floor division ( // ) - Exponentiation ( ** ) - - Example: - operator['+', '*', '-'] - array = [2, 3, 4, 5] - result = 2 + 3 * 4 - 5 - => result = 9 - - Note: - The length of operator list is equal to the length of operand list minus one. - Operand is a list of of non-negative integers. - Operator list has at least one operator, and operand list has at least two operands. - - """ - -""" -Do lists diye gaye hain, operator aur operand. Pehla list basic algebra operations ka hai, aur - dusra list integers ka hai. Diye gaye do lists ka use karke algebraic - expression banaye aur is expression ka evaluation return kare. - - Basic algebra operations: - Addition ( + ) - Subtraction ( - ) - Multiplication ( * ) - Floor division ( // ) - Exponentiation ( ** ) - - Udaharan: - operator['+', '*', '-'] - array = [2, 3, 4, 5] - result = 2 + 3 * 4 - 5 - => result = 9 - - Dhyan de: - Operator list ki length operand list ki length se ek kam hoti hai. - Operand ek non-negative integers ki list hoti hai. - Operator list me kam se kam ek operator hota hai, aur operand list me kam se kam do operands hote hain. - -""" \ No newline at end of file diff --git a/translation/drafts/161 b/translation/drafts/161 deleted file mode 100644 index 066f5be4..00000000 --- a/translation/drafts/161 +++ /dev/null @@ -1,22 +0,0 @@ -"""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 - solve("1234") = "4321" - solve("ab") = "AB" - solve("#a@C") = "#A@c" - """ - -""" -Aapko ek string s di gayi hai. - Agar s[i] ek letter hai, to uska case reverse karo lower se upper ya vise versa, - nahi to waise hi rakho jaisa hai. - Agar string me koi letters nahi hai, to string ko reverse karo. - Function ko resulted string return karni chahiye. - Udaharan - solve("1234") = "4321" - solve("ab") = "AB" - solve("#a@C") = "#A@c" -""" \ No newline at end of file diff --git a/translation/drafts/162 b/translation/drafts/162 deleted file mode 100644 index e159af42..00000000 --- a/translation/drafts/162 +++ /dev/null @@ -1,13 +0,0 @@ -""" - Given a string 'text', return its md5 hash equivalent string. - If 'text' is an empty string, return None. - - >>> string_to_md5('Hello world') == '3e25960a79dbc69b674cd4ec67a72c62' - """ - -""" -Ek string 'text' di gayi hai, uska md5 hash equivalent string return karo. - Agar 'text' ek khali string hai, to None return karo. - - >>> string_to_md5('Hello world') == '3e25960a79dbc69b674cd4ec67a72c62' -""" \ No newline at end of file diff --git a/translation/drafts/163 b/translation/drafts/163 deleted file mode 100644 index 44a5a6af..00000000 --- a/translation/drafts/163 +++ /dev/null @@ -1,18 +0,0 @@ -""" - Given two positive integers a and b, return the even digits between a - and b, in ascending order. - - For example: - generate_integers(2, 8) => [2, 4, 6, 8] - generate_integers(8, 2) => [2, 4, 6, 8] - generate_integers(10, 14) => [] - """ - -""" -Do positive integers a aur b diye gaye hain, a aur b ke beech ke even digits ko ascending order mein return karo. - - Jaise ki: - generate_integers(2, 8) => [2, 4, 6, 8] - generate_integers(8, 2) => [2, 4, 6, 8] - generate_integers(10, 14) => [] -""" \ No newline at end of file diff --git a/translation/drafts/17 b/translation/drafts/17 deleted file mode 100644 index 8cfa1755..00000000 --- a/translation/drafts/17 +++ /dev/null @@ -1,26 +0,0 @@ -""" 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 - 'o|' - half note, lasts two beats - '.|' - quater note, lasts one beat - - >>> parse_music('o o| .| o| o| .| .| .| .| o o') - [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4] - """ - -""" -Is function ka input ek string hai jo musical notes ko ek special ASCII format mein represent karta hai. - Aapka kaam hai is string ko parse karna aur ek integers ki list return karna jo correspond karti hai ki har note kitne beats tak chalta hai. - - Yaha ek legend hai: - 'o' - whole note, jo four beats tak chalta hai - 'o|' - half note, jo two beats tak chalta hai - '.|' - quater note, jo one beat tak chalta hai - - >>> parse_music('o o| .| o| o| .| .| .| .| o o') - [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4] - -""" diff --git a/translation/drafts/18 b/translation/drafts/18 deleted file mode 100644 index 81ddacce..00000000 --- a/translation/drafts/18 +++ /dev/null @@ -1,18 +0,0 @@ -""" Find how many times a given substring can be found in the original string. Count overlaping cases. - >>> how_many_times('', 'a') - 0 - >>> how_many_times('aaa', 'a') - 3 - >>> how_many_times('aaaa', 'aa') - 3 - """ - -""" -Mool string mein diye gaye substring ko kitni baar mila ja sakta hai, yeh find karo. Overlapping cases ko bhi count karo. - >>> how_many_times('', 'a') - 0 - >>> how_many_times('aaa', 'a') - 3 - >>> how_many_times('aaaa', 'aa') - 3 -""" \ No newline at end of file diff --git a/translation/drafts/19 b/translation/drafts/19 deleted file mode 100644 index fa149580..00000000 --- a/translation/drafts/19 +++ /dev/null @@ -1,14 +0,0 @@ -""" 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 - >>> sort_numbers('three one five') - 'one three five' - """ - -""" -Input ek space-delimited string hai jisme 'zero' se 'nine' tak ke numerals hain. - Valid choices 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' aur 'nine' hain. - Return karo string ko jisme numbers smallest se largest tak sorted honge - >>> sort_numbers('three one five') - 'one three five' -""" diff --git a/translation/drafts/2 b/translation/drafts/2 deleted file mode 100644 index d9ff5353..00000000 --- a/translation/drafts/2 +++ /dev/null @@ -1,17 +0,0 @@ -""" 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. - >>> truncate_number(3.5) - 0.5 - """ - -""" -Diye gaye positive floating point number ko hum integer part (diye gaye number se chota sabse bada integer) aur decimals - (hamesha 1 se chota bacha hua part) mein decompose kar sakte hain. - - Number ka decimal part return karo. - >>> truncate_number(3.5) - 0.5 -""" \ No newline at end of file diff --git a/translation/drafts/20 b/translation/drafts/20 deleted file mode 100644 index 7194035f..00000000 --- a/translation/drafts/20 +++ /dev/null @@ -1,15 +0,0 @@ -""" 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). - >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.2]) - (2.0, 2.2) - >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.0]) - (2.0, 2.0) - """ - -""" -Diye gaye numbers ki list se (jo ki kam se kam do numbers ki honi chahiye) do aise numbers chun ke return karo jo ek dusre ke sabse kareeb ho aur unhe order mein return karo (chota number, bada number). - >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.2]) - (2.0, 2.2) - >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.0]) - (2.0, 2.0) -""" \ No newline at end of file diff --git a/translation/drafts/21 b/translation/drafts/21 deleted file mode 100644 index b6931140..00000000 --- a/translation/drafts/21 +++ /dev/null @@ -1,12 +0,0 @@ -""" 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 - >>> rescale_to_unit([1.0, 2.0, 3.0, 4.0, 5.0]) - [0.0, 0.25, 0.5, 0.75, 1.0] - """ - -""" -Diye gaye numbers ki list (kam se kam do elements ki) par ek linear transform apply karo, - aisa ki sabse chota number 0 ban jaye aur sabse bada number 1 ban jaye - >>> rescale_to_unit([1.0, 2.0, 3.0, 4.0, 5.0]) - [0.0, 0.25, 0.5, 0.75, 1.0] -""" \ No newline at end of file diff --git a/translation/drafts/22 b/translation/drafts/22 deleted file mode 100644 index 9d22b232..00000000 --- a/translation/drafts/22 +++ /dev/null @@ -1,14 +0,0 @@ -""" Filter given list of any python values only for integers - >>> filter_integers(['a', 3.14, 5]) - [5] - >>> filter_integers([1, 2, 3, 'abc', {}, []]) - [1, 2, 3] - """ - -""" -Diye gaye python values ki list ko sirf integers ke liye filter karo - >>> filter_integers(['a', 3.14, 5]) - [5] - >>> filter_integers([1, 2, 3, 'abc', {}, []]) - [1, 2, 3] -""" \ No newline at end of file diff --git a/translation/drafts/23 b/translation/drafts/23 deleted file mode 100644 index b4686728..00000000 --- a/translation/drafts/23 +++ /dev/null @@ -1,14 +0,0 @@ -""" Return length of given string - >>> strlen('') - 0 - >>> strlen('abc') - 3 - """ - -""" -Diye gaye string ki length return karo - >>> strlen('') - 0 - >>> strlen('abc') - 3 -""" \ No newline at end of file diff --git a/translation/drafts/24 b/translation/drafts/24 deleted file mode 100644 index 4dbd2183..00000000 --- a/translation/drafts/24 +++ /dev/null @@ -1,10 +0,0 @@ -""" For a given number n, find the largest number that divides n evenly, smaller than n - >>> largest_divisor(15) - 5 - """ - -""" -Diye gaye number n ke liye, sabse bada number dhundo jo n ko evenly divide karta ho, jo ki n se chota ho. - >>> largest_divisor(15) - 5 -""" \ No newline at end of file diff --git a/translation/drafts/25 b/translation/drafts/25 deleted file mode 100644 index f58e3570..00000000 --- a/translation/drafts/25 +++ /dev/null @@ -1,22 +0,0 @@ -""" 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 - >>> factorize(8) - [2, 2, 2] - >>> factorize(25) - [5, 5] - >>> factorize(70) - [2, 5, 7] - """ - -""" -Diye gaye integer ke prime factors ki list return karo, jiska order chhote se bade tak hona chahiye. - Har ek factor ko utni baar list mein hona chahiye jitni baar wo factorization mein aata hai. - Input number sabhi factors ke product ke barabar hona chahiye - >>> factorize(8) - [2, 2, 2] - >>> factorize(25) - [5, 5] - >>> factorize(70) - [2, 5, 7] -""" diff --git a/translation/drafts/26 b/translation/drafts/26 deleted file mode 100644 index 0214348b..00000000 --- a/translation/drafts/26 +++ /dev/null @@ -1,12 +0,0 @@ -""" From a list of integers, remove all elements that occur more than once. - Keep order of elements left the same as in the input. - >>> remove_duplicates([1, 2, 3, 2, 4]) - [1, 3, 4] - """ - -""" -Ek integers ki list se, saare elements hata do jo ek se zyada baar occur karte hain. - Bache hue elements ka order input ke jaisa hi rakho. - >>> remove_duplicates([1, 2, 3, 2, 4]) - [1, 3, 4] -""" \ No newline at end of file diff --git a/translation/drafts/27 b/translation/drafts/27 deleted file mode 100644 index 506b00f5..00000000 --- a/translation/drafts/27 +++ /dev/null @@ -1,10 +0,0 @@ -""" For a given string, flip lowercase characters to uppercase and uppercase to lowercase. - >>> flip_case('Hello') - 'hELLO' - """ - -""" -Diye gaye string ke liye, lowercase characters ko uppercase me aur uppercase characters ko lowercase me flip karo. - >>> flip_case('Hello') - 'hELLO' -""" \ No newline at end of file diff --git a/translation/drafts/28 b/translation/drafts/28 deleted file mode 100644 index aaf11641..00000000 --- a/translation/drafts/28 +++ /dev/null @@ -1,14 +0,0 @@ -""" Concatenate list of strings into a single string - >>> concatenate([]) - '' - >>> concatenate(['a', 'b', 'c']) - 'abc' - """ - -""" -Strings ki list ko ek single string mein jodo - >>> concatenate([]) - '' - >>> concatenate(['a', 'b', 'c']) - 'abc' -""" \ No newline at end of file diff --git a/translation/drafts/29 b/translation/drafts/29 deleted file mode 100644 index d92a1758..00000000 --- a/translation/drafts/29 +++ /dev/null @@ -1,14 +0,0 @@ -""" Filter an input list of strings only for ones that start with a given prefix. - >>> filter_by_prefix([], 'a') - [] - >>> filter_by_prefix(['abc', 'bcd', 'cde', 'array'], 'a') - ['abc', 'array'] - """ - -""" -Diye gaye prefix se shuru hone wale strings ke liye input list ko filter karo. - >>> filter_by_prefix([], 'a') - [] - >>> filter_by_prefix(['abc', 'bcd', 'cde', 'array'], 'a') - ['abc', 'array'] -""" \ No newline at end of file diff --git a/translation/drafts/3 b/translation/drafts/3 deleted file mode 100644 index 7a21d4f0..00000000 --- a/translation/drafts/3 +++ /dev/null @@ -1,16 +0,0 @@ -""" 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. - >>> below_zero([1, 2, 3]) - False - >>> below_zero([1, 2, -4, 5]) - True - """ - -""" -Aapko ek list di gayi hai jisme bank account ke deposit aur withdrawal operations hain, jiska shuruat zero balance se hota hai. Aapka task hai detect karna ki agar kisi point pe account ka balance zero se kam ho jata hai, to us point pe function ko True return karna chahiye. Varna ise False return karna chahiye. - >>> below_zero([1, 2, 3]) - False - >>> below_zero([1, 2, -4, 5]) - True -""" diff --git a/translation/drafts/30 b/translation/drafts/30 deleted file mode 100644 index f6f8fcfc..00000000 --- a/translation/drafts/30 +++ /dev/null @@ -1,14 +0,0 @@ -"""Return only positive numbers in the list. - >>> get_positive([-1, 2, -4, 5, 6]) - [2, 5, 6] - >>> get_positive([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]) - [5, 3, 2, 3, 9, 123, 1] - """ - -""" -List mein se sirf positive numbers return karo. - >>> get_positive([-1, 2, -4, 5, 6]) - [2, 5, 6] - >>> get_positive([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]) - [5, 3, 2, 3, 9, 123, 1] -""" \ No newline at end of file diff --git a/translation/drafts/31 b/translation/drafts/31 deleted file mode 100644 index 393982c4..00000000 --- a/translation/drafts/31 +++ /dev/null @@ -1,34 +0,0 @@ -"""Return true if a given number is prime, and false otherwise. - >>> is_prime(6) - False - >>> is_prime(101) - True - >>> is_prime(11) - True - >>> is_prime(13441) - True - >>> is_prime(61) - True - >>> is_prime(4) - False - >>> is_prime(1) - False - """ - -""" -Agar diya gaya number prime hai to true return karo, aur anyatha false. - >>> is_prime(6) - False - >>> is_prime(101) - True - >>> is_prime(11) - True - >>> is_prime(13441) - True - >>> is_prime(61) - True - >>> is_prime(4) - False - >>> is_prime(1) - False -""" \ No newline at end of file diff --git a/translation/drafts/32 b/translation/drafts/32 deleted file mode 100644 index 4f03a177..00000000 --- a/translation/drafts/32 +++ /dev/null @@ -1,9 +0,0 @@ -""" - Evaluates polynomial with coefficients xs at point x. - return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n - """ - -""" -Polynomial ko evaluate karo coefficients xs ke saath point x par. - return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n -""" diff --git a/translation/drafts/33 b/translation/drafts/33 deleted file mode 100644 index b6a07147..00000000 --- a/translation/drafts/33 +++ /dev/null @@ -1,18 +0,0 @@ -"""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. - >>> sort_third([1, 2, 3]) - [1, 2, 3] - >>> sort_third([5, 6, 3, 4, 8, 9, 2]) - [2, 6, 3, 4, 8, 9, 5] - """ - -""" -Yeh function ek list l leta hai aur ek list l' return karta hai aisa ki - l' wahi hai jaisa l hai un indices par jo three se divisible nahi hote, jabki uske values un indices par jo three se divisible hote hain, wahi hoti hain - jaisi corresponding indices ki values l ki hoti hain, lekin sorted. - >>> sort_third([1, 2, 3]) - [1, 2, 3] - >>> sort_third([5, 6, 3, 4, 8, 9, 2]) - [2, 6, 3, 4, 8, 9, 5] -""" \ No newline at end of file diff --git a/translation/drafts/34 b/translation/drafts/34 deleted file mode 100644 index e5504bf9..00000000 --- a/translation/drafts/34 +++ /dev/null @@ -1,10 +0,0 @@ -"""Return sorted unique elements in a list - >>> unique([5, 3, 5, 2, 3, 3, 9, 0, 123]) - [0, 2, 3, 5, 9, 123] - """ - -""" -Ek list mein sorted unique elements return karo - >>> unique([5, 3, 5, 2, 3, 3, 9, 0, 123]) - [0, 2, 3, 5, 9, 123] -""" \ No newline at end of file diff --git a/translation/drafts/35 b/translation/drafts/35 deleted file mode 100644 index b984ca0f..00000000 --- a/translation/drafts/35 +++ /dev/null @@ -1,15 +0,0 @@ -"""Return maximum element in the list. - >>> max_element([1, 2, 3]) - 3 - >>> max_element([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]) - 123 - """ - -""" -List mein se maximum element return karo. - >>> max_element([1, 2, 3]) - 3 - >>> max_element([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]) - 123 - -""" \ No newline at end of file diff --git a/translation/drafts/36 b/translation/drafts/36 deleted file mode 100644 index 8da097d1..00000000 --- a/translation/drafts/36 +++ /dev/null @@ -1,18 +0,0 @@ -"""Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13. - >>> fizz_buzz(50) - 0 - >>> fizz_buzz(78) - 2 - >>> fizz_buzz(79) - 3 - """ - -""" -n se kam integers mein, jo 11 ya 13 se divisible hain, usme digit 7 kitni baar aata hai, uska count return karo. - >>> fizz_buzz(50) - 0 - >>> fizz_buzz(78) - 2 - >>> fizz_buzz(79) - 3 -""" \ No newline at end of file diff --git a/translation/drafts/37 b/translation/drafts/37 deleted file mode 100644 index 5e2d1f73..00000000 --- a/translation/drafts/37 +++ /dev/null @@ -1,18 +0,0 @@ -"""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. - >>> sort_even([1, 2, 3]) - [1, 2, 3] - >>> sort_even([5, 6, 3, 4]) - [3, 6, 5, 4] - """ - -""" -Yeh function ek list l leta hai aur ek list l' return karta hai aisa ki - list l' list l ke odd indices ke saath identical hota hai, jabki uske even indices ke values - l ke even indices ke values ke barabar hoti hai, lekin sorted. - >>> sort_even([1, 2, 3]) - [1, 2, 3] - >>> sort_even([5, 6, 3, 4]) - [3, 6, 5, 4] -""" diff --git a/translation/drafts/38 b/translation/drafts/38 deleted file mode 100644 index e7c7f4f2..00000000 --- a/translation/drafts/38 +++ /dev/null @@ -1,7 +0,0 @@ -""" - returns encoded string by cycling groups of three characters. - """ - -""" -teen characters ke groups ko cycle karke encoded string return karta hai. -""" \ No newline at end of file diff --git a/translation/drafts/39 b/translation/drafts/39 deleted file mode 100644 index 70cd3386..00000000 --- a/translation/drafts/39 +++ /dev/null @@ -1,27 +0,0 @@ -""" - prime_fib returns n-th number that is a Fibonacci number and it's also prime. - >>> prime_fib(1) - 2 - >>> prime_fib(2) - 3 - >>> prime_fib(3) - 5 - >>> prime_fib(4) - 13 - >>> prime_fib(5) - 89 - """ - -""" -prime_fib woh n-th number return karta hai jo ek Fibonacci number bhi hai aur prime number bhi. - >>> prime_fib(1) - 2 - >>> prime_fib(2) - 3 - >>> prime_fib(3) - 5 - >>> prime_fib(4) - 13 - >>> prime_fib(5) - 89 -""" \ No newline at end of file diff --git a/translation/drafts/4 b/translation/drafts/4 deleted file mode 100644 index 1003bd2c..00000000 --- a/translation/drafts/4 +++ /dev/null @@ -1,16 +0,0 @@ -""" 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 | - >>> mean_absolute_deviation([1.0, 2.0, 3.0, 4.0]) - 1.0 - """ - -""" -Diye gaye input numbers ki list ke liye, dataset ka Mean Absolute Deviation calculate karo. - Mean Absolute Deviation har element aur ek centerpoint (is case mein mean) ke beech ke absolute difference ka average hota hai. - MAD = average | x - x_mean | - >>> mean_absolute_deviation([1.0, 2.0, 3.0, 4.0]) - 1.0 -""" diff --git a/translation/drafts/40 b/translation/drafts/40 deleted file mode 100644 index 5b9befbd..00000000 --- a/translation/drafts/40 +++ /dev/null @@ -1,34 +0,0 @@ -""" - 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. - - >>> triples_sum_to_zero([1, 3, 5, 0]) - False - >>> triples_sum_to_zero([1, 3, -2, 1]) - True - >>> triples_sum_to_zero([1, 2, 3, 7]) - False - >>> triples_sum_to_zero([2, 4, -5, 3, 9, 7]) - True - >>> triples_sum_to_zero([1]) - False - """ - -""" -triples_sum_to_zero ek integers ki list ka input leta hai. - Yeh True return karta hai agar list mein teen distinct elements hain jinka - sum zero hai, aur anyatha False. - - >>> triples_sum_to_zero([1, 3, 5, 0]) - False - >>> triples_sum_to_zero([1, 3, -2, 1]) - True - >>> triples_sum_to_zero([1, 2, 3, 7]) - False - >>> triples_sum_to_zero([2, 4, -5, 3, 9, 7]) - True - >>> triples_sum_to_zero([1]) - False - -""" diff --git a/translation/drafts/41 b/translation/drafts/41 deleted file mode 100644 index 27644877..00000000 --- a/translation/drafts/41 +++ /dev/null @@ -1,23 +0,0 @@ -""" - 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. - """ - -""" -Socho ek road ko jo ek perfectly straight aur infinitely long line hai. - n cars left se right ki taraf ja rahi hain; saath hi, ek alag set of n cars - right se left ki taraf ja rahi hain. Dono set of cars shuruat mein ek dusre se bahut door hoti hain. - Saari cars same speed mein move karti hain. Do cars tab takraati hain jab - ek car jo left se right ja rahi hoti hai, right se left ja rahi car se takraati hai. - Lekin, cars infinitely sturdy aur strong hoti hain; isliye, unka movement - unke trajectory mein continue hota hai jaise ki unka collision hua hi nahi. - - Ye function aise collisions ki sankhya output karta hai. -""" \ No newline at end of file diff --git a/translation/drafts/42 b/translation/drafts/42 deleted file mode 100644 index d7c85324..00000000 --- a/translation/drafts/42 +++ /dev/null @@ -1,14 +0,0 @@ -"""Return list with elements incremented by 1. - >>> incr_list([1, 2, 3]) - [2, 3, 4] - >>> incr_list([5, 3, 5, 2, 3, 3, 9, 0, 123]) - [6, 4, 6, 3, 4, 4, 10, 1, 124] - """ - -""" -Elements ko 1 se badhakar list return karo. - >>> incr_list([1, 2, 3]) - [2, 3, 4] - >>> incr_list([5, 3, 5, 2, 3, 3, 9, 0, 123]) - [6, 4, 6, 3, 4, 4, 10, 1, 124] -""" diff --git a/translation/drafts/43 b/translation/drafts/43 deleted file mode 100644 index a6773b83..00000000 --- a/translation/drafts/43 +++ /dev/null @@ -1,32 +0,0 @@ -""" - 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. - >>> pairs_sum_to_zero([1, 3, 5, 0]) - False - >>> pairs_sum_to_zero([1, 3, -2, 1]) - False - >>> pairs_sum_to_zero([1, 2, 3, 7]) - False - >>> pairs_sum_to_zero([2, 4, -5, 3, 5, 7]) - True - >>> pairs_sum_to_zero([1]) - False - """ - -""" -pairs_sum_to_zero ek integers ki list ko input leta hai. - Yeh True return karta hai agar list mein do alag elements ho jinka - sum zero ke barabar ho, aur anyatha False. - >>> pairs_sum_to_zero([1, 3, 5, 0]) - False - >>> pairs_sum_to_zero([1, 3, -2, 1]) - False - >>> pairs_sum_to_zero([1, 2, 3, 7]) - False - >>> pairs_sum_to_zero([2, 4, -5, 3, 5, 7]) - True - >>> pairs_sum_to_zero([1]) - False - -""" diff --git a/translation/drafts/44 b/translation/drafts/44 deleted file mode 100644 index 8ed63808..00000000 --- a/translation/drafts/44 +++ /dev/null @@ -1,22 +0,0 @@ -"""Change numerical base of input number x to base. - return string representation after the conversion. - base numbers are less than 10. - >>> change_base(8, 3) - '22' - >>> change_base(8, 2) - '1000' - >>> change_base(7, 2) - '111' - """ - -""" -Input number x ka numerical base, dusre base me badalo. - Conversion ke baad string representation return karo. - Base numbers 10 se kam hote hain. - >>> change_base(8, 3) - '22' - >>> change_base(8, 2) - '1000' - >>> change_base(7, 2) - '111' -""" diff --git a/translation/drafts/45 b/translation/drafts/45 deleted file mode 100644 index f80a62f6..00000000 --- a/translation/drafts/45 +++ /dev/null @@ -1,10 +0,0 @@ -"""Given length of a side and high return area for a triangle. - >>> triangle_area(5, 3) - 7.5 - """ - -""" -Ek side ki length aur height di gayi ho to, triangle ka area return karo. - >>> triangle_area(5, 3) - 7.5 -""" \ No newline at end of file diff --git a/translation/drafts/46 b/translation/drafts/46 deleted file mode 100644 index 92a58b9c..00000000 --- a/translation/drafts/46 +++ /dev/null @@ -1,31 +0,0 @@ -"""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. - >>> fib4(5) - 4 - >>> fib4(6) - 8 - >>> fib4(7) - 14 - """ - -""" -Fib4 number sequence ek sequence hai jo Fibbonacci sequence ke saman hai, jo is prakar se define kiya gaya hai: - 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). - Kripya ek function likhe jo efficiently fib4 number sequence ka n-th element compute kare. Recursion ka use na kare. - >>> fib4(5) - 4 - >>> fib4(6) - 8 - >>> fib4(7) - 14 - -""" \ No newline at end of file diff --git a/translation/drafts/47 b/translation/drafts/47 deleted file mode 100644 index b4855df6..00000000 --- a/translation/drafts/47 +++ /dev/null @@ -1,14 +0,0 @@ -"""Return median of elements in the list l. - >>> median([3, 1, 2, 4, 5]) - 3 - >>> median([-10, 4, 6, 1000, 10, 20]) - 15.0 - """ - -""" -List l ke elements ka median return karo. - >>> median([3, 1, 2, 4, 5]) - 3 - >>> median([-10, 4, 6, 1000, 10, 20]) - 15.0 -""" \ No newline at end of file diff --git a/translation/drafts/48 b/translation/drafts/48 deleted file mode 100644 index a34742e3..00000000 --- a/translation/drafts/48 +++ /dev/null @@ -1,23 +0,0 @@ -""" - Checks if given string is a palindrome - >>> is_palindrome('') - True - >>> is_palindrome('aba') - True - >>> is_palindrome('aaaaa') - True - >>> is_palindrome('zbcd') - False - """ - -""" -Diye gaye string ko check karo ki kya yeh palindrome hai - >>> is_palindrome('') - True - >>> is_palindrome('aba') - True - >>> is_palindrome('aaaaa') - True - >>> is_palindrome('zbcd') - False -""" diff --git a/translation/drafts/49 b/translation/drafts/49 deleted file mode 100644 index e2f302ea..00000000 --- a/translation/drafts/49 +++ /dev/null @@ -1,26 +0,0 @@ -"""Return 2^n modulo p (be aware of numerics). - >>> modp(3, 5) - 3 - >>> modp(1101, 101) - 2 - >>> modp(0, 101) - 1 - >>> modp(3, 11) - 8 - >>> modp(100, 101) - 1 - """ - -""" -2^n modulo p return karo (numerics ka dhyan rakho). - >>> modp(3, 5) - 3 - >>> modp(1101, 101) - 2 - >>> modp(0, 101) - 1 - >>> modp(3, 11) - 8 - >>> modp(100, 101) - 1 -""" \ No newline at end of file diff --git a/translation/drafts/5 b/translation/drafts/5 deleted file mode 100644 index f52e1309..00000000 --- a/translation/drafts/5 +++ /dev/null @@ -1,14 +0,0 @@ -""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers' - >>> intersperse([], 4) - [] - >>> intersperse([1, 2, 3], 4) - [1, 4, 2, 4, 3] - """ - -""" -Input list `numbers' ke har do consecutive elements ke beech mein ek number 'delimeter' insert karo. - >>> intersperse([], 4) - [] - >>> intersperse([1, 2, 3], 4) - [1, 4, 2, 4, 3] -""" \ No newline at end of file diff --git a/translation/drafts/50 b/translation/drafts/50 deleted file mode 100644 index 92b961fc..00000000 --- a/translation/drafts/50 +++ /dev/null @@ -1,7 +0,0 @@ -""" - returns encoded string by shifting every character by 5 in the alphabet. - """ - -""" -Har character ko alphabet mein 5 se shift karke encoded string return karta hai. -""" diff --git a/translation/drafts/51 b/translation/drafts/51 deleted file mode 100644 index 7af38e96..00000000 --- a/translation/drafts/51 +++ /dev/null @@ -1,31 +0,0 @@ -""" - remove_vowels is a function that takes string and returns string without vowels. - >>> remove_vowels('') - '' - >>> remove_vowels("abcdef\nghijklm") - 'bcdf\nghjklm' - >>> remove_vowels('abcdef') - 'bcdf' - >>> remove_vowels('aaaaa') - '' - >>> remove_vowels('aaBAA') - 'B' - >>> remove_vowels('zbcd') - 'zbcd' - """ - -""" -remove_vowels ek function hai jo string leta hai aur vowels ke bina string return karta hai. - >>> remove_vowels('') - '' - >>> remove_vowels("abcdef\nghijklm") - 'bcdf\nghjklm' - >>> remove_vowels('abcdef') - 'bcdf' - >>> remove_vowels('aaaaa') - '' - >>> remove_vowels('aaBAA') - 'B' - >>> remove_vowels('zbcd') - 'zbcd' -""" \ No newline at end of file diff --git a/translation/drafts/52 b/translation/drafts/52 deleted file mode 100644 index 6079f35c..00000000 --- a/translation/drafts/52 +++ /dev/null @@ -1,14 +0,0 @@ -"""Return True if all numbers in the list l are below threshold t. - >>> below_threshold([1, 2, 4, 10], 100) - True - >>> below_threshold([1, 20, 4, 10], 5) - False - """ - -""" -Agar list l mein saare numbers threshold t se kam hai to True return karo. - >>> below_threshold([1, 2, 4, 10], 100) - True - >>> below_threshold([1, 20, 4, 10], 5) - False -""" \ No newline at end of file diff --git a/translation/drafts/53 b/translation/drafts/53 deleted file mode 100644 index 334fcc32..00000000 --- a/translation/drafts/53 +++ /dev/null @@ -1,14 +0,0 @@ -"""Add two numbers x and y - >>> add(2, 3) - 5 - >>> add(5, 7) - 12 - """ - -""" -Do numbers x aur y ko jodo - >>> add(2, 3) - 5 - >>> add(5, 7) - 12 -""" \ No newline at end of file diff --git a/translation/drafts/54 b/translation/drafts/54 deleted file mode 100644 index 8b1e43a9..00000000 --- a/translation/drafts/54 +++ /dev/null @@ -1,31 +0,0 @@ -""" - Check if two words have the same characters. - >>> same_chars('eabcdzzzz', 'dddzzzzzzzddeddabc') - True - >>> same_chars('abcd', 'dddddddabc') - True - >>> same_chars('dddddddabc', 'abcd') - True - >>> same_chars('eabcd', 'dddddddabc') - False - >>> same_chars('abcd', 'dddddddabce') - False - >>> same_chars('eabcdzzzz', 'dddzzzzzzzddddabc') - False - """ - -""" -Check karo ki do shabd me same characters hai ya nahi. - >>> same_chars('eabcdzzzz', 'dddzzzzzzzddeddabc') - True - >>> same_chars('abcd', 'dddddddabc') - True - >>> same_chars('dddddddabc', 'abcd') - True - >>> same_chars('eabcd', 'dddddddabc') - False - >>> same_chars('abcd', 'dddddddabce') - False - >>> same_chars('eabcdzzzz', 'dddzzzzzzzddddabc') - False -""" diff --git a/translation/drafts/55 b/translation/drafts/55 deleted file mode 100644 index 37c0d947..00000000 --- a/translation/drafts/55 +++ /dev/null @@ -1,18 +0,0 @@ -"""Return n-th Fibonacci number. - >>> fib(10) - 55 - >>> fib(1) - 1 - >>> fib(8) - 21 - """ - -""" -n-th Fibonacci number return karo. - >>> fib(10) - 55 - >>> fib(1) - 1 - >>> fib(8) - 21 -""" \ No newline at end of file diff --git a/translation/drafts/56 b/translation/drafts/56 deleted file mode 100644 index 1d1d3d21..00000000 --- a/translation/drafts/56 +++ /dev/null @@ -1,26 +0,0 @@ -""" brackets is a string of "<" and ">". - return True if every opening bracket has a corresponding closing bracket. - - >>> correct_bracketing("<") - False - >>> correct_bracketing("<>") - True - >>> correct_bracketing("<<><>>") - True - >>> correct_bracketing("><<>") - False - """ - -""" -brackets ek string hai "<" aur ">" ka. - return True agar har opening bracket ka ek corresponding closing bracket ho. - - >>> correct_bracketing("<") - False - >>> correct_bracketing("<>") - True - >>> correct_bracketing("<<><>>") - True - >>> correct_bracketing("><<>") - False -""" \ No newline at end of file diff --git a/translation/drafts/57 b/translation/drafts/57 deleted file mode 100644 index 82a7122f..00000000 --- a/translation/drafts/57 +++ /dev/null @@ -1,18 +0,0 @@ -"""Return True is list elements are monotonically increasing or decreasing. - >>> monotonic([1, 2, 4, 20]) - True - >>> monotonic([1, 20, 4, 10]) - False - >>> monotonic([4, 1, 0, -10]) - True - """ - -""" -True return karo agar list ke elements monotonically badh rahe ho ya ghat rahe ho. - >>> monotonic([1, 2, 4, 20]) - True - >>> monotonic([1, 20, 4, 10]) - False - >>> monotonic([4, 1, 0, -10]) - True -""" \ No newline at end of file diff --git a/translation/drafts/58 b/translation/drafts/58 deleted file mode 100644 index 2042ea2b..00000000 --- a/translation/drafts/58 +++ /dev/null @@ -1,16 +0,0 @@ -"""Return sorted unique common elements for two lists. - >>> common([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]) - [1, 5, 653] - >>> common([5, 3, 2, 8], [3, 2]) - [2, 3] - - """ - -""" -Do lists ke liye sorted unique common elements return karo. - >>> common([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]) - [1, 5, 653] - >>> common([5, 3, 2, 8], [3, 2]) - [2, 3] - -""" \ No newline at end of file diff --git a/translation/drafts/59 b/translation/drafts/59 deleted file mode 100644 index e77656b6..00000000 --- a/translation/drafts/59 +++ /dev/null @@ -1,14 +0,0 @@ -"""Return the largest prime factor of n. Assume n > 1 and is not a prime. - >>> largest_prime_factor(13195) - 29 - >>> largest_prime_factor(2048) - 2 - """ - -""" -n ka sabse bada prime factor return karo. Maan lo ki n > 1 hai aur yeh prime nahi hai. - >>> largest_prime_factor(13195) - 29 - >>> largest_prime_factor(2048) - 2 -""" \ No newline at end of file diff --git a/translation/drafts/6 b/translation/drafts/6 deleted file mode 100644 index 5c1ad2bf..00000000 --- a/translation/drafts/6 +++ /dev/null @@ -1,17 +0,0 @@ -""" Input to this function is a string represented multiple groups for nested parentheses separated by spaces. - For each of the group, output the deepest level of nesting of parentheses. - E.g. (()()) has maximum two levels of nesting while ((())) has three. - - >>> parse_nested_parens('(()()) ((())) () ((())()())') - [2, 3, 1, 3] - """ - -""" -Is function ka input ek string hai jisme nested parentheses ke multiple groups hai, jo spaces ke dwara alag kiye gaye hai. - Har group ke liye, sabse andar ke nested parentheses ke level ko output kare. - Jaise ki, (()()) ki maximum do levels ki nesting hai jabki ((())) ki teen hai. - - >>> parse_nested_parens('(()()) ((())) () ((())()())') - [2, 3, 1, 3] - -""" diff --git a/translation/drafts/60 b/translation/drafts/60 deleted file mode 100644 index fb2723c1..00000000 --- a/translation/drafts/60 +++ /dev/null @@ -1,27 +0,0 @@ -"""sum_to_n is a function that sums numbers from 1 to n. - >>> sum_to_n(30) - 465 - >>> sum_to_n(100) - 5050 - >>> sum_to_n(5) - 15 - >>> sum_to_n(10) - 55 - >>> sum_to_n(1) - 1 - """ - -""" -sum_to_n ek function hai jo 1 se lekar n tak ke numbers ka sum karta hai. - >>> sum_to_n(30) - 465 - >>> sum_to_n(100) - 5050 - >>> sum_to_n(5) - 15 - >>> sum_to_n(10) - 55 - >>> sum_to_n(1) - 1 - -""" \ No newline at end of file diff --git a/translation/drafts/61 b/translation/drafts/61 deleted file mode 100644 index 808439ee..00000000 --- a/translation/drafts/61 +++ /dev/null @@ -1,26 +0,0 @@ -""" brackets is a string of "(" and ")". - return True if every opening bracket has a corresponding closing bracket. - - >>> correct_bracketing("(") - False - >>> correct_bracketing("()") - True - >>> correct_bracketing("(()())") - True - >>> correct_bracketing(")(()") - False - """ - -""" -brackets ek string hai "(" aur ")" ka. - return True agar har opening bracket ka ek corresponding closing bracket ho. - - >>> correct_bracketing("(") - False - >>> correct_bracketing("()") - True - >>> correct_bracketing("(()())") - True - >>> correct_bracketing(")(()") - False -""" \ No newline at end of file diff --git a/translation/drafts/62 b/translation/drafts/62 deleted file mode 100644 index 01f7aca9..00000000 --- a/translation/drafts/62 +++ /dev/null @@ -1,18 +0,0 @@ -""" xs represent coefficients of a polynomial. - xs[0] + xs[1] * x + xs[2] * x^2 + .... - Return derivative of this polynomial in the same form. - >>> derivative([3, 1, 2, 4, 5]) - [1, 4, 12, 20] - >>> derivative([1, 2, 3]) - [2, 6] - """ - -""" -xs ek polynomial ke coefficients ko represent karte hain. - xs[0] + xs[1] * x + xs[2] * x^2 + .... - Is polynomial ka derivative same form mein return karo. - >>> derivative([3, 1, 2, 4, 5]) - [1, 4, 12, 20] - >>> derivative([1, 2, 3]) - [2, 6] -""" \ No newline at end of file diff --git a/translation/drafts/63 b/translation/drafts/63 deleted file mode 100644 index 36068122..00000000 --- a/translation/drafts/63 +++ /dev/null @@ -1,29 +0,0 @@ -"""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. - >>> fibfib(1) - 0 - >>> fibfib(5) - 4 - >>> fibfib(8) - 24 - """ - -""" -FibFib number sequence ek sequence hai jo Fibbonacci sequence ke saman hai aur iska definition is prakar hai: - fibfib(0) == 0 - fibfib(1) == 0 - fibfib(2) == 1 - fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3). - Kripya ek function likhe jo efficiently fibfib number sequence ka n-th element compute kare. - >>> fibfib(1) - 0 - >>> fibfib(5) - 4 - >>> fibfib(8) - 24 - -""" \ No newline at end of file diff --git a/translation/drafts/64 b/translation/drafts/64 deleted file mode 100644 index 361995bd..00000000 --- a/translation/drafts/64 +++ /dev/null @@ -1,7 +0,0 @@ -""" -Add more test cases. -""" - -""" -Aur test cases jodo. -""" \ No newline at end of file diff --git a/translation/drafts/65 b/translation/drafts/65 deleted file mode 100644 index 401437eb..00000000 --- a/translation/drafts/65 +++ /dev/null @@ -1,18 +0,0 @@ -"""Circular shift the digits of the integer x, shift the digits right by shift - and return the result as a string. - If shift > number of digits, return digits reversed. - >>> circular_shift(12, 1) - "21" - >>> circular_shift(12, 2) - "12" - """ - -""" -Integer x ke digits ko circular shift karo, digits ko right mein shift karo by shift - aur result ko string ke roop mein return karo. - Agar shift > digits ki number ho, toh reversed digits return karo. - >>> circular_shift(12, 1) - "21" - >>> circular_shift(12, 2) - "12" -""" \ No newline at end of file diff --git a/translation/drafts/66 b/translation/drafts/66 deleted file mode 100644 index 0fa03997..00000000 --- a/translation/drafts/66 +++ /dev/null @@ -1,27 +0,0 @@ -"""Task - Write a function that takes a string as input and returns the sum of the upper characters only' - ASCII codes. - - Examples: - digitSum("") => 0 - digitSum("abAB") => 131 - digitSum("abcCd") => 67 - digitSum("helloE") => 69 - digitSum("woArBld") => 131 - digitSum("aAaaaXa") => 153 - """ - -""" -Task - Ek function likho jo ek string ko input ke roop mein leta hai aur sirf upper characters' - ASCII codes ka sum return karta hai. - - Udaharan: - digitSum("") => 0 - digitSum("abAB") => 131 - digitSum("abcCd") => 67 - digitSum("helloE") => 69 - digitSum("woArBld") => 131 - digitSum("aAaaaXa") => 153 - -""" \ No newline at end of file diff --git a/translation/drafts/67 b/translation/drafts/67 deleted file mode 100644 index 58249b4e..00000000 --- a/translation/drafts/67 +++ /dev/null @@ -1,24 +0,0 @@ -""" - 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 integer that represent the total number of the fruits - in the basket return the number of the mango fruits in the basket. - for examble: - fruit_distribution("5 apples and 6 oranges", 19) ->19 - 5 - 6 = 8 - fruit_distribution("0 apples and 1 oranges",3) -> 3 - 0 - 1 = 2 - fruit_distribution("2 apples and 3 oranges", 100) -> 100 - 2 - 3 = 95 - fruit_distribution("100 apples and 1 oranges",120) -> 120 - 100 - 1 = 19 - """ - -""" -Is task mein, aapko ek string di jayegi jo ek fruit basket mein distribute -kiye gaye apples aur oranges ki sankhya ko darshati hai.Ye basket mein apples, oranges, aur mango fruits hote hain. -Diye gaye string se jo total number of oranges aur apples ko darshati hai aur ek integer jo basket -mein total fruits ki sankhya ko darshati hai, usko use karke basket mein mango fruits ki sankhya return karo. - Jaise ki: - fruit_distribution("5 apples and 6 oranges", 19) ->19 - 5 - 6 = 8 - fruit_distribution("0 apples and 1 oranges",3) -> 3 - 0 - 1 = 2 - fruit_distribution("2 apples and 3 oranges", 100) -> 100 - 2 - 3 = 95 - fruit_distribution("100 apples and 1 oranges",120) -> 120 - 100 - 1 = 19 -""" diff --git a/translation/drafts/68 b/translation/drafts/68 deleted file mode 100644 index e3eaa938..00000000 --- a/translation/drafts/68 +++ /dev/null @@ -1,68 +0,0 @@ -""" - "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 []. - - Example 1: - Input: [4,2,3] - Output: [2, 1] - Explanation: 2 has the smallest even value, and 2 has the smallest index. - - Example 2: - Input: [1,2,3] - Output: [2, 1] - Explanation: 2 has the smallest even value, and 2 has the smallest index. - - Example 3: - Input: [] - Output: [] - - Example 4: - Input: [5, 0, 3, 0, 4, 2] - Output: [0, 1] - Explanation: 0 is the smallest value, but there are two zeros, - so we will choose the first zero, which has the smallest index. - - Constraints: - * 1 <= nodes.length <= 10000 - * 0 <= node.value - """ - -""" -"Ek array diya gaya hai jo ek tree ki branch ko represent karta hai jisme non-negative integer nodes hote hain - aapka task hai ek node ko pluck karke return karna. - Plucked node woh hona chahiye jiska sabse chhota even value ho. - Agar multiple nodes milte hain jinka same sabse chhota even value ho toh woh node return karo jiska sabse chhota index ho. - - Plucked node ko ek list me return karna chahiye, [ sabse_chhota_value, uska index ], - Agar koi bhi even values na ho ya diya gaya array khali ho, toh [] return karo. - - Example 1: - Input: [4,2,3] - Output: [2, 1] - Explanation: 2 ka sabse chhota even value hai, aur 2 ka sabse chhota index hai. - - Example 2: - Input: [1,2,3] - Output: [2, 1] - Explanation: 2 ka sabse chhota even value hai, aur 2 ka sabse chhota index hai. - - Example 3: - Input: [] - Output: [] - - Example 4: - Input: [5, 0, 3, 0, 4, 2] - Output: [0, 1] - Explanation: 0 sabse chhota value hai, lekin yahan do zeros hain, - isliye hum pehla zero choose karenge, jiska sabse chhota index hai. - - Constraints: - * 1 <= nodes.length <= 10000 - * 0 <= node.value - -""" \ No newline at end of file diff --git a/translation/drafts/69 b/translation/drafts/69 deleted file mode 100644 index e3052999..00000000 --- a/translation/drafts/69 +++ /dev/null @@ -1,22 +0,0 @@ -""" - 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. - Examples: - search([4, 1, 2, 2, 3, 1]) == 2 - search([1, 2, 2, 3, 3, 3, 4, 4, 4]) == 3 - search([5, 5, 4, 4, 4]) == -1 - """ - -""" -Aapko ek non-empty list di gayi hai positive integers ki. Return karo sabse bada integer jo zero se bada ho, - aur uska frequency us integer ke value ke barabar ya usse zyada ho. - Ek integer ka frequency uski list mein kitni baar aane ki sankhya hoti hai. - Agar aisa koi value nahi hai, to -1 return karo. - Udaharan: - search([4, 1, 2, 2, 3, 1]) == 2 - search([1, 2, 2, 3, 3, 3, 4, 4, 4]) == 3 - search([5, 5, 4, 4, 4]) == -1 - -""" \ No newline at end of file diff --git a/translation/drafts/7 b/translation/drafts/7 deleted file mode 100644 index 723ad1cf..00000000 --- a/translation/drafts/7 +++ /dev/null @@ -1,14 +0,0 @@ -""" Filter an input list of strings only for ones that contain given substring - >>> filter_by_substring([], 'a') - [] - >>> filter_by_substring(['abc', 'bacd', 'cde', 'array'], 'a') - ['abc', 'bacd', 'array'] - """ - -""" -Diye gaye input list ko sirf un strings ke liye filter karo jo diye gaye substring ko contain karti hain - >>> filter_by_substring([], 'a') - [] - >>> filter_by_substring(['abc', 'bacd', 'cde', 'array'], 'a') - ['abc', 'bacd', 'array'] -""" \ No newline at end of file diff --git a/translation/drafts/70 b/translation/drafts/70 deleted file mode 100644 index ec973f94..00000000 --- a/translation/drafts/70 +++ /dev/null @@ -1,22 +0,0 @@ -""" - Given list of integers, return list in strange order. - Strange sorting, is when you start with the minimum value, - then maximum of the remaining integers, then minimum and so on. - - Examples: - strange_sort_list([1, 2, 3, 4]) == [1, 4, 2, 3] - strange_sort_list([5, 5, 5, 5]) == [5, 5, 5, 5] - strange_sort_list([]) == [] - """ - -""" -Diye gaye integers ki list ko, strange order mein return karo. - Strange sorting, tab hoti hai jab aap minimum value se start karte ho, - phir remaining integers ki maximum value, phir minimum aur aise hi aage badhte ho. - - Udaharan: - strange_sort_list([1, 2, 3, 4]) == [1, 4, 2, 3] - strange_sort_list([5, 5, 5, 5]) == [5, 5, 5, 5] - strange_sort_list([]) == [] - -""" \ No newline at end of file diff --git a/translation/drafts/71 b/translation/drafts/71 deleted file mode 100644 index 6897bdc2..00000000 --- a/translation/drafts/71 +++ /dev/null @@ -1,19 +0,0 @@ -""" - Given the lengths of the three sides of a triangle. Return the area of - the triangle rounded to 2 decimal points if the three sides form a valid triangle. - Otherwise return -1 - Three sides make a valid triangle when the sum of any two sides is greater - than the third side. - Example: - triangle_area(3, 4, 5) == 6.00 - triangle_area(1, 2, 10) == -1 - """ - -""" -Triangle ke teeno sides ke lengths diye gaye hain. Agar teeno sides ek valid triangle banate hain to triangle ka area 2 decimal points tak round off karke return karo. - Anyatha -1 return karo. - Teen sides tabhi ek valid triangle banati hain jab kisi bhi do sides ka sum teesri side se zyada hota hai. - Udaharan: - triangle_area(3, 4, 5) == 6.00 - triangle_area(1, 2, 10) == -1 -""" diff --git a/translation/drafts/72 b/translation/drafts/72 deleted file mode 100644 index 8cca5bf2..00000000 --- a/translation/drafts/72 +++ /dev/null @@ -1,35 +0,0 @@ -""" - Write a function that returns True if the object q will fly, and False otherwise. - The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w. - - Example: - will_it_fly([1, 2], 5) ➞ False - # 1+2 is less than the maximum possible weight, but it's unbalanced. - - will_it_fly([3, 2, 3], 1) ➞ False - # it's balanced, but 3+2+3 is more than the maximum possible weight. - - will_it_fly([3, 2, 3], 9) ➞ True - # 3+2+3 is less than the maximum possible weight, and it's balanced. - - will_it_fly([3], 5) ➞ True - # 3 is less than the maximum possible weight, and it's balanced. - """ - -""" -Ek function likho jo True return kare agar object q udega, aur False otherwise. - Object q tabhi udega jab vo balanced ho (yani ki ek palindromic list ho) aur uske elements ka sum maximum possible weight w se kam ya barabar ho. - - Udaharan: - will_it_fly([1, 2], 5) ➞ False - # 1+2 maximum possible weight se kam hai, lekin ye balanced nahi hai. - - will_it_fly([3, 2, 3], 1) ➞ False - # ye balanced hai, lekin 3+2+3 maximum possible weight se jyada hai. - - will_it_fly([3, 2, 3], 9) ➞ True - # 3+2+3 maximum possible weight se kam hai, aur ye balanced hai. - - will_it_fly([3], 5) ➞ True - # 3 maximum possible weight se kam hai, aur ye balanced hai. -""" \ No newline at end of file diff --git a/translation/drafts/73 b/translation/drafts/73 deleted file mode 100644 index 47fdb684..00000000 --- a/translation/drafts/73 +++ /dev/null @@ -1,22 +0,0 @@ -""" - 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. - - For example: - smallest_change([1,2,3,5,4,7,9,6]) == 4 - smallest_change([1, 2, 3, 4, 3, 2, 2]) == 1 - smallest_change([1, 2, 3, 2, 1]) == 0 - """ - -""" -Ek array arr diya gaya hai integers ka, usme se minimum kitne elements ko change karna padega - taaki array palindromic ban jaye. Ek palindromic array woh hota hai jo aage se bhi aur peeche se bhi - same padhta hai. Ek change me, aap ek element ko kisi bhi dusre element se replace kar sakte ho. - - Jaise ki: - smallest_change([1,2,3,5,4,7,9,6]) == 4 - smallest_change([1, 2, 3, 4, 3, 2, 2]) == 1 - smallest_change([1, 2, 3, 2, 1]) == 0 - -""" \ No newline at end of file diff --git a/translation/drafts/74 b/translation/drafts/74 deleted file mode 100644 index 24d4cc21..00000000 --- a/translation/drafts/74 +++ /dev/null @@ -1,27 +0,0 @@ -""" - Write a function that accepts two lists of strings and returns the list that has - total number of chars in the all strings of the list less than the other list. - - if the two lists have the same number of chars, return the first list. - - Examples - total_match([], []) ➞ [] - total_match(['hi', 'admin'], ['hI', 'Hi']) ➞ ['hI', 'Hi'] - total_match(['hi', 'admin'], ['hi', 'hi', 'admin', 'project']) ➞ ['hi', 'admin'] - total_match(['hi', 'admin'], ['hI', 'hi', 'hi']) ➞ ['hI', 'hi', 'hi'] - total_match(['4'], ['1', '2', '3', '4', '5']) ➞ ['4'] - """ - -""" -Ek function likho jo do string ki lists ko accept kare aur woh list return kare jisme - total number of chars saare strings me dusre list se kam ho. - - Agar dono lists me same number of chars ho, toh pehli list return karo. - - Udaharan - total_match([], []) ➞ [] - total_match(['hi', 'admin'], ['hI', 'Hi']) ➞ ['hI', 'Hi'] - total_match(['hi', 'admin'], ['hi', 'hi', 'admin', 'project']) ➞ ['hi', 'admin'] - total_match(['hi', 'admin'], ['hI', 'hi', 'hi']) ➞ ['hI', 'hi', 'hi'] - total_match(['4'], ['1', '2', '3', '4', '5']) ➞ ['4'] -""" \ No newline at end of file diff --git a/translation/drafts/75 b/translation/drafts/75 deleted file mode 100644 index 5950b064..00000000 --- a/translation/drafts/75 +++ /dev/null @@ -1,16 +0,0 @@ -"""Write a function that returns true if the given number is the multiplication of 3 prime numbers - and false otherwise. - Knowing that (a) is less then 100. - Example: - is_multiply_prime(30) == True - 30 = 2 * 3 * 5 - """ - -""" -Ek function likho jo true return kare agar diya gaya number 3 prime numbers ka multiplication hai - aur false agar aisa nahi hai. - Jahan (a) 100 se kam hai. - Udaharan: - is_multiply_prime(30) == True - 30 = 2 * 3 * 5 -""" \ No newline at end of file diff --git a/translation/drafts/76 b/translation/drafts/76 deleted file mode 100644 index a57daa54..00000000 --- a/translation/drafts/76 +++ /dev/null @@ -1,25 +0,0 @@ -"""Your task is to write a function that returns true if a number x is a simple - power of n and false in other cases. - x is a simple power of n if n**int=x - For example: - is_simple_power(1, 4) => true - is_simple_power(2, 2) => true - is_simple_power(8, 2) => true - is_simple_power(3, 2) => false - is_simple_power(3, 1) => false - is_simple_power(5, 3) => false - """ - -""" -Aapka task hai ek function likhna jo true return kare agar number x, n ka simple - power hai aur false return kare baaki cases mein. - x n ka simple power hai agar n**int=x - Jaise ki: - is_simple_power(1, 4) => true - is_simple_power(2, 2) => true - is_simple_power(8, 2) => true - is_simple_power(3, 2) => false - is_simple_power(3, 1) => false - is_simple_power(5, 3) => false - -""" diff --git a/translation/drafts/77 b/translation/drafts/77 deleted file mode 100644 index 94834953..00000000 --- a/translation/drafts/77 +++ /dev/null @@ -1,25 +0,0 @@ -""" - Write a function that takes an integer a and returns True - if this ingeger is a cube of some integer number. - Note: you may assume the input is always valid. - Examples: - iscube(1) ==> True - iscube(2) ==> False - iscube(-1) ==> True - iscube(64) ==> True - iscube(0) ==> True - iscube(180) ==> False - """ - -""" -Ek function likho jo ek integer a leta hai aur True return karta hai - agar yeh integer kisi integer number ka cube hai. - Dhyan de: aap maan sakte ho ki input hamesha valid hoga. - Udaharan: - iscube(1) ==> True - iscube(2) ==> False - iscube(-1) ==> True - iscube(64) ==> True - iscube(0) ==> True - iscube(180) ==> False -""" \ No newline at end of file diff --git a/translation/drafts/78 b/translation/drafts/78 deleted file mode 100644 index dcbe8586..00000000 --- a/translation/drafts/78 +++ /dev/null @@ -1,31 +0,0 @@ -"""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 are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F. - Prime numbers are 2, 3, 5, 7, 11, 13, 17,... - So you have to determine a number of the following digits: 2, 3, 5, 7, - B (=decimal 11), D (=decimal 13). - Note: you may assume the input is always correct or empty string, - and symbols A,B,C,D,E,F are always uppercase. - Examples: - For num = "AB" the output should be 1. - For num = "1077E" the output should be 2. - For num = "ABED1A33" the output should be 4. - For num = "123456789ABCDEF0" the output should be 6. - For num = "2020" the output should be 2. - """ - -""" -Aapko ek function likhna hai jo ek hexadecimal number ko string ke roop mein leta hai aur ginta hai ki kitne hexadecimal digits prime hain (prime number, ya prime, ek natural number hota hai jo 1 se bada hota hai aur do chote natural numbers ka product nahi hota). - Hexadecimal digits hote hain 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F. - Prime numbers hote hain 2, 3, 5, 7, 11, 13, 17,... - To aapko ye determine karna hai ki nimn digits ki sankhya kitni hai: 2, 3, 5, 7, B (=decimal 11), D (=decimal 13). - Note: aap maan sakte hain ki input hamesha sahi ya empty string hoga, aur symbols A,B,C,D,E,F hamesha uppercase mein honge. - Examples: - Agar num = "AB" hai to output 1 hona chahiye. - Agar num = "1077E" hai to output 2 hona chahiye. - Agar num = "ABED1A33" hai to output 4 hona chahiye. - Agar num = "123456789ABCDEF0" hai to output 6 hona chahiye. - Agar num = "2020" hai to output 2 hona chahiye. -""" diff --git a/translation/drafts/79 b/translation/drafts/79 deleted file mode 100644 index 817f3826..00000000 --- a/translation/drafts/79 +++ /dev/null @@ -1,24 +0,0 @@ -"""You will be given a number in decimal form and your task is to convert it to - binary format. The function should return a string, with each character representing a binary - number. Each character in the string will be '0' or '1'. - - There will be an extra couple of characters 'db' at the beginning and at the end of the string. - The extra characters are there to help with the format. - - Examples: - decimal_to_binary(15) # returns "db1111db" - decimal_to_binary(32) # returns "db100000db" - """ - -""" -Aapko ek number decimal form mein diya jayega aur aapka task hai use - binary format mein convert karna. Function ek string return karega, jisme har character ek binary - number ko represent karega. String mein har character '0' ya '1' hoga. - - String ke shuru aur ant mein 'db' naam ke kuch extra characters honge. - Ye extra characters format ki sahayata ke liye diye gaye hain. - - Udaharan: - decimal_to_binary(15) # deta hai "db1111db" - decimal_to_binary(32) # deta hai "db100000db" -""" diff --git a/translation/drafts/8 b/translation/drafts/8 deleted file mode 100644 index 499d8d39..00000000 --- a/translation/drafts/8 +++ /dev/null @@ -1,16 +0,0 @@ -""" For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list. - Empty sum should be equal to 0 and empty product should be equal to 1. - >>> sum_product([]) - (0, 1) - >>> sum_product([1, 2, 3, 4]) - (10, 24) - """ - -""" - Diye gaye integer list ke liye, ek tuple return karo jismei list ke saare integers ka sum aur product ho. - Empty list ke sum ko 0 aur product ko 1 ke barabar hona chahiye. - >>> sum_product([]) - (0, 1) - >>> sum_product([1, 2, 3, 4]) - (10, 24) -""" diff --git a/translation/drafts/80 b/translation/drafts/80 deleted file mode 100644 index 98c903bc..00000000 --- a/translation/drafts/80 +++ /dev/null @@ -1,24 +0,0 @@ -"""You are given a string s. - Your task is to check if the string is happy or not. - A string is happy if its length is at least 3 and every 3 consecutive letters are distinct - For example: - is_happy(a) => False - is_happy(aa) => False - is_happy(abcd) => True - is_happy(aabb) => False - is_happy(adb) => True - is_happy(xyy) => False - """ - -""" -Aapko ek string s di gayi hai. - Aapka task hai check karna ki string happy hai ya nahi. - Ek string tabhi happy hogi jab uski length kam se kam 3 ho aur har 3 consecutive letters distinct ho. - Jaise ki: - is_happy(a) => False - is_happy(aa) => False - is_happy(abcd) => True - is_happy(aabb) => False - is_happy(adb) => True - is_happy(xyy) => False -""" \ No newline at end of file diff --git a/translation/drafts/81 b/translation/drafts/81 deleted file mode 100644 index 16716daf..00000000 --- a/translation/drafts/81 +++ /dev/null @@ -1,51 +0,0 @@ -"""It is the last week of the semester and the teacher has to give the grades - to students. The teacher has been making her own algorithm for grading. - The only problem is, she has lost the code she used for grading. - She has given you a list of GPAs for some students and you have to write - a function that can output a list of letter grades using the following table: - GPA | Letter grade - 4.0 A+ - > 3.7 A - > 3.3 A- - > 3.0 B+ - > 2.7 B - > 2.3 B- - > 2.0 C+ - > 1.7 C - > 1.3 C- - > 1.0 D+ - > 0.7 D - > 0.0 D- - 0.0 E - - - Example: - grade_equation([4.0, 3, 1.7, 2, 3.5]) ==> ['A+', 'B', 'C-', 'C', 'A-'] - """ - -""" -Yeh semester ka aakhri week hai aur teacher ko students ko grades dena hai. - Teacher ne apna khud ka algorithm banaya hai grading ke liye. - Sirf ek problem hai, unhone jo code use kiya tha grading ke liye, woh kho gaya hai. - Unhone aapko kuch students ke GPAs ki list di hai aur aapko ek function likhna hai - jo letter grades ki list output kar sake, neeche diye gaye table ke hisaab se: - GPA | Letter grade - 4.0 A+ - > 3.7 A - > 3.3 A- - > 3.0 B+ - > 2.7 B - > 2.3 B- - > 2.0 C+ - > 1.7 C - > 1.3 C- - > 1.0 D+ - > 0.7 D - > 0.0 D- - 0.0 E - - - Udaharan: - grade_equation([4.0, 3, 1.7, 2, 3.5]) ==> ['A+', 'B', 'C-', 'C', 'A-'] - -""" diff --git a/translation/drafts/82 b/translation/drafts/82 deleted file mode 100644 index ecb8498a..00000000 --- a/translation/drafts/82 +++ /dev/null @@ -1,18 +0,0 @@ -"""Write a function that takes a string and returns True if the string - length is a prime number or False otherwise - Examples - prime_length('Hello') == True - prime_length('abcdcba') == True - prime_length('kittens') == True - prime_length('orange') == False - """ - -""" -Ek function likho jo ek string leta hai aur return karta hai True agar string - ki length ek prime number hai ya False agar nahi ho - Udaharan - prime_length('Hello') == True - prime_length('abcdcba') == True - prime_length('kittens') == True - prime_length('orange') == False -""" diff --git a/translation/drafts/83 b/translation/drafts/83 deleted file mode 100644 index 78c70fd2..00000000 --- a/translation/drafts/83 +++ /dev/null @@ -1,8 +0,0 @@ -""" - Given a positive integer n, return the count of the numbers of n-digit - positive integers that start or end with 1. - """ - -""" -Diye gaye positive integer n ke liye, n-digit wale positive integers ki ginti return karo jo 1 se shuru hote hain ya 1 pe end hote hain. -""" diff --git a/translation/drafts/84 b/translation/drafts/84 deleted file mode 100644 index 038c6f55..00000000 --- a/translation/drafts/84 +++ /dev/null @@ -1,29 +0,0 @@ -"""Given a positive integer N, return the total sum of its digits in binary. - - Example - For N = 1000, the sum of digits will be 1 the output should be "1". - For N = 150, the sum of digits will be 6 the output should be "110". - For N = 147, the sum of digits will be 12 the output should be "1100". - - Variables: - @N integer - Constraints: 0 ≤ N ≤ 10000. - Output: - a string of binary number - """ - -""" -Diye gaye positive integer N ke digits ka total sum binary mein return karo. - - Udaharan - Agar N = 1000 hai, to digits ka sum hoga 1 aur output honi chahiye "1". - Agar N = 150 hai, to digits ka sum hoga 6 aur output honi chahiye "110". - Agar N = 147 hai, to digits ka sum hoga 12 aur output honi chahiye "1100". - - Variables: - @N integer - Constraints: 0 ≤ N ≤ 10000. - Output: - binary number ka ek string - -""" diff --git a/translation/drafts/85 b/translation/drafts/85 deleted file mode 100644 index aad0875a..00000000 --- a/translation/drafts/85 +++ /dev/null @@ -1,13 +0,0 @@ -"""Given a non-empty list of integers lst. add the even elements that are at odd indices.. - - - Examples: - add([4, 2, 6, 7]) ==> 2 - """ - -""" -Ek non-empty list di gayi hai integers ki lst. Add karo even elements ko jo odd indices pe hai. - - Udaharan: - add([4, 2, 6, 7]) ==> 2 -""" \ No newline at end of file diff --git a/translation/drafts/86 b/translation/drafts/86 deleted file mode 100644 index 4dc05a9c..00000000 --- a/translation/drafts/86 +++ /dev/null @@ -1,25 +0,0 @@ -""" - 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 order of words and blank spaces in the sentence. - - For example: - anti_shuffle('Hi') returns 'Hi' - anti_shuffle('hello') returns 'ehllo' - anti_shuffle('Hello World!!!') returns 'Hello !!!Wdlor' - """ - -""" -Ek function likho jo ek string leta hai aur uska ordered version return karta hai. - String ka ordered version, woh string hoti hai jahan saare words (space se separated) - ko ek naye word se replace kiya jata hai jisme saare characters ko - unke ascii value ke basis pe ascending order mein arrange kiya jata hai. - Dhyan do: Aapko words aur blank spaces ki order sentence mein maintain karni chahiye. - - Jaise ki: - anti_shuffle('Hi') returns 'Hi' - anti_shuffle('hello') returns 'ehllo' - anti_shuffle('Hello World!!!') returns 'Hello !!!Wdlor' -""" diff --git a/translation/drafts/87 b/translation/drafts/87 deleted file mode 100644 index 3bcd7e12..00000000 --- a/translation/drafts/87 +++ /dev/null @@ -1,39 +0,0 @@ -""" - You are given a 2 dimensional data, as a nested lists, - which is similar to matrix, however, unlike matrices, - each row may contain a different number of columns. - Given lst, and integer x, find integers x in the list, - and return list of tuples, [(x1, y1), (x2, y2) ...] such that - each tuple is a coordinate - (row, columns), starting with 0. - Sort coordinates initially by rows in ascending order. - Also, sort coordinates of the row by columns in descending order. - - Examples: - get_row([ - [1,2,3,4,5,6], - [1,2,3,4,1,6], - [1,2,3,4,5,1] - ], 1) == [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)] - get_row([], 1) == [] - get_row([[], [1], [1, 2, 3]], 3) == [(2, 2)] - """ - -""" -Aapko ek 2 dimensional data diya gaya hai, ek nested lists ke roop mein, - jo matrix ke saman hai, lekin, matrices ke unlike, - har row mein alag number of columns ho sakte hain. - Diye gaye lst, aur integer x, list mein integers x ko dhundho, - aur tuples ki list return karo, [(x1, y1), (x2, y2) ...] aisa ki - har tuple ek coordinate ho - (row, columns), shuru karte hue 0 se. - Coordinates ko pehle rows ke hisaab se ascending order mein sort karo. - Saath hi, row ke coordinates ko columns ke hisaab se descending order mein sort karo. - - Udaharan: - get_row([ - [1,2,3,4,5,6], - [1,2,3,4,1,6], - [1,2,3,4,5,1] - ], 1) == [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)] - get_row([], 1) == [] - get_row([[], [1], [1, 2, 3]], 3) == [(2, 2)] -""" diff --git a/translation/drafts/88 b/translation/drafts/88 deleted file mode 100644 index d1bc8ee7..00000000 --- a/translation/drafts/88 +++ /dev/null @@ -1,29 +0,0 @@ -""" - Given an array of non-negative integers, return a copy of the given array after sorting, - you will sort the given array in ascending order if the sum( first index value, last index value) is odd, - or sort it in descending order if the sum( first index value, last index value) is even. - - Note: - * don't change the given array. - - Examples: - * sort_array([]) => [] - * sort_array([5]) => [5] - * sort_array([2, 4, 3, 0, 1, 5]) => [0, 1, 2, 3, 4, 5] - * sort_array([2, 4, 3, 0, 1, 5, 6]) => [6, 5, 4, 3, 2, 1, 0] - """ - -""" -Non-negative integers ki ek array di gayi hai, return karo us array ka copy, sort karne ke baad, - aapko di gayi array ko ascending order mein sort karna hai agar sum( pehle index ki value, last index ki value) odd hai, - ya fir descending order mein sort karna hai agar sum( pehle index ki value, last index ki value) even hai. - - Dhyan do: - * di gayi array ko change mat karo. - - Examples: - * sort_array([]) => [] - * sort_array([5]) => [5] - * sort_array([2, 4, 3, 0, 1, 5]) => [0, 1, 2, 3, 4, 5] - * sort_array([2, 4, 3, 0, 1, 5, 6]) => [6, 5, 4, 3, 2, 1, 0] -""" diff --git a/translation/drafts/89 b/translation/drafts/89 deleted file mode 100644 index 51e66a3a..00000000 --- a/translation/drafts/89 +++ /dev/null @@ -1,22 +0,0 @@ -"""Create a function encrypt that takes a string as an argument and - returns a string encrypted with the alphabet being rotated. - The alphabet should be rotated in a manner such that the letters - shift down by two multiplied to two places. - For example: - encrypt('hi') returns 'lm' - encrypt('asdfghjkl') returns 'ewhjklnop' - encrypt('gf') returns 'kj' - encrypt('et') returns 'ix' - """ - -""" -Ek function banaiye encrypt jo ek string ko argument ke roop mein leta hai aur - ek encrypted string return karta hai jisme alphabet ko rotate kiya gaya ho. - Alphabet ko aise rotate karna chahiye ki letters - do se multiply kiye gaye do places ke neeche shift ho jaye. - Jaise ki: - encrypt('hi') returns 'lm' - encrypt('asdfghjkl') returns 'ewhjklnop' - encrypt('gf') returns 'kj' - encrypt('et') returns 'ix' -""" \ No newline at end of file diff --git a/translation/drafts/9 b/translation/drafts/9 deleted file mode 100644 index a3f14b9d..00000000 --- a/translation/drafts/9 +++ /dev/null @@ -1,11 +0,0 @@ -""" From a given list of integers, generate a list of rolling maximum element found until given moment - in the sequence. - >>> rolling_max([1, 2, 3, 2, 3, 4, 2]) - [1, 2, 3, 3, 3, 4, 4] - """ - -""" -Diye gaye integers ki list mei se, sequence me diye gaye har moment tak paye gaye rolling maximum element ki list generate karo. - >>> rolling_max([1, 2, 3, 2, 3, 4, 2]) - [1, 2, 3, 3, 3, 4, 4] -""" diff --git a/translation/drafts/90 b/translation/drafts/90 deleted file mode 100644 index f68cec77..00000000 --- a/translation/drafts/90 +++ /dev/null @@ -1,22 +0,0 @@ -""" - You are given a list of integers. - Write a function next_smallest() that returns the 2nd smallest element of the list. - Return None if there is no such element. - - next_smallest([1, 2, 3, 4, 5]) == 2 - next_smallest([5, 1, 4, 3, 2]) == 2 - next_smallest([]) == None - next_smallest([1, 1]) == None - """ - -""" -Aapko ek list di gayi hai integers ki. - Ek function likho next_smallest() jo list ka dusra sabse chhota element return kare. - Agar aisa koi element nahi hai to None return kare. - - next_smallest([1, 2, 3, 4, 5]) == 2 - next_smallest([5, 1, 4, 3, 2]) == 2 - next_smallest([]) == None - next_smallest([1, 1]) == None - -""" diff --git a/translation/drafts/91 b/translation/drafts/91 deleted file mode 100644 index 1d18d81e..00000000 --- a/translation/drafts/91 +++ /dev/null @@ -1,22 +0,0 @@ -""" - You'll be given a string of words, and your task is to count the number - of boredoms. A boredom is a sentence that starts with the word "I". - Sentences are delimited by '.', '?' or '!'. - - For example: - >>> is_bored("Hello world") - 0 - >>> is_bored("The sky is blue. The sun is shining. I love this weather") - 1 - """ - -""" -Aapko ek string di jayegi jisme words honge, aur aapko ginna hai ki us string me kitne boredoms hai. Ek boredom woh sentence hota hai jo "I" word se start hota hai. - Sentences ko '.' , '?' ya '!' se alag kiya jata hai. - - Udaharan ke liye: - >>> is_bored("Hello world") - 0 - >>> is_bored("The sky is blue. The sun is shining. I love this weather") - 1 -""" diff --git a/translation/drafts/92 b/translation/drafts/92 deleted file mode 100644 index 42161e54..00000000 --- a/translation/drafts/92 +++ /dev/null @@ -1,33 +0,0 @@ -""" - Create a function that takes 3 numbers. - Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers. - Returns false in any other cases. - - Examples - any_int(5, 2, 7) ➞ True - - any_int(3, 2, 2) ➞ False - - any_int(3, -2, 1) ➞ True - - any_int(3.6, -2.2, 2) ➞ False - - - - """ - -""" -Ek function banao jo 3 numbers leta hai. - Agar koi bhi ek number doosre dono numbers ka sum ho, aur saare numbers integers ho, toh true return kare. - Kisi bhi aur case mein false return kare. - - Udaharan - any_int(5, 2, 7) ➞ True - - any_int(3, 2, 2) ➞ False - - any_int(3, -2, 1) ➞ True - - any_int(3.6, -2.2, 2) ➞ False - -""" diff --git a/translation/drafts/93 b/translation/drafts/93 deleted file mode 100644 index 8352dab2..00000000 --- a/translation/drafts/93 +++ /dev/null @@ -1,26 +0,0 @@ -""" - Write a function that takes a message, and encodes in such a - way that it swaps case of all letters, replaces all vowels in - the message with the letter that appears 2 places ahead of that - vowel in the english alphabet. - Assume only letters. - - Examples: - >>> encode('test') - 'TGST' - >>> encode('This is a message') - 'tHKS KS C MGSSCGG' - """ - -""" -Ek function likho jo ek message leta hai, aur usko aise encode karta hai - ki wo saare letter ki case ko swap kar deta hai, saare vowels ko - unke aage wale 2nd letter se replace kar deta hai english alphabet mein. - Sirf letters maano. - - Udaharan: - >>> encode('test') - 'TGST' - >>> encode('This is a message') - 'tHKS KS C MGSSCGG' -""" diff --git a/translation/drafts/94 b/translation/drafts/94 deleted file mode 100644 index 1c5d8aa3..00000000 --- a/translation/drafts/94 +++ /dev/null @@ -1,25 +0,0 @@ -"""You are given a list of integers. - You need to find the largest prime value and return the sum of its digits. - - Examples: - For lst = [0,3,2,1,3,5,7,4,5,5,5,2,181,32,4,32,3,2,32,324,4,3] the output should be 10 - For lst = [1,0,1,8,2,4597,2,1,3,40,1,2,1,2,4,2,5,1] the output should be 25 - For lst = [1,3,1,32,5107,34,83278,109,163,23,2323,32,30,1,9,3] the output should be 13 - For lst = [0,724,32,71,99,32,6,0,5,91,83,0,5,6] the output should be 11 - For lst = [0,81,12,3,1,21] the output should be 3 - For lst = [0,8,1,2,1,7] the output should be 7 - """ - -""" -Aapko ek integers ki list di gayi hai. - Aapko sabse bada prime value dhundna hai aur uske digits ka sum return karna hai. - - Udaharan: - Agar lst = [0,3,2,1,3,5,7,4,5,5,5,2,181,32,4,32,3,2,32,324,4,3] hai to output hona chahiye 10 - Agar lst = [1,0,1,8,2,4597,2,1,3,40,1,2,1,2,4,2,5,1] hai to output hona chahiye 25 - Agar lst = [1,3,1,32,5107,34,83278,109,163,23,2323,32,30,1,9,3] hai to output hona chahiye 13 - Agar lst = [0,724,32,71,99,32,6,0,5,91,83,0,5,6] hai to output hona chahiye 11 - Agar lst = [0,81,12,3,1,21] hai to output hona chahiye 3 - Agar lst = [0,8,1,2,1,7] hai to output hona chahiye 7 - -""" diff --git a/translation/drafts/95 b/translation/drafts/95 deleted file mode 100644 index c4d2af4b..00000000 --- a/translation/drafts/95 +++ /dev/null @@ -1,22 +0,0 @@ -""" - Given a dictionary, return True if all keys are strings in lower - case or all keys are strings in upper case, else return False. - The function should return False is the given dictionary is empty. - Examples: - check_dict_case({"a":"apple", "b":"banana"}) should return True. - check_dict_case({"a":"apple", "A":"banana", "B":"banana"}) should return False. - check_dict_case({"a":"apple", 8:"banana", "a":"apple"}) should return False. - check_dict_case({"Name":"John", "Age":"36", "City":"Houston"}) should return False. - check_dict_case({"STATE":"NC", "ZIP":"12345" }) should return True. - """ - -""" -Ek dictionary jo di gayi hai, True return karo agar saare keys lower case strings hai ya saare keys upper case strings hai, nahi to return karo False. - Agar di gayi dictionary khali hai to function False return karega. - Udaharan: - check_dict_case({"a":"apple", "b":"banana"}) ka return hona chahiye True. - check_dict_case({"a":"apple", "A":"banana", "B":"banana"}) ka return hona chahiye False. - check_dict_case({"a":"apple", 8:"banana", "a":"apple"}) ka return hona chahiye False. - check_dict_case({"Name":"John", "Age":"36", "City":"Houston"}) ka return hona chahiye False. - check_dict_case({"STATE":"NC", "ZIP":"12345" }) ka return hona chahiye True. -""" diff --git a/translation/drafts/96 b/translation/drafts/96 deleted file mode 100644 index c4614c89..00000000 --- a/translation/drafts/96 +++ /dev/null @@ -1,23 +0,0 @@ -"""Implement a function that takes an non-negative integer and returns an array of the first n - integers that are prime numbers and less than n. - for example: - count_up_to(5) => [2,3] - count_up_to(11) => [2,3,5,7] - count_up_to(0) => [] - count_up_to(20) => [2,3,5,7,11,13,17,19] - count_up_to(1) => [] - count_up_to(18) => [2,3,5,7,11,13,17] - """ - -""" -Ek function implement karo jo ek non-negative integer leta hai aur ek array return karta hai jisme pehle n - integers hote hai jo prime numbers hai aur n se kam hai. - Jaise ki: - count_up_to(5) => [2,3] - count_up_to(11) => [2,3,5,7] - count_up_to(0) => [] - count_up_to(20) => [2,3,5,7,11,13,17,19] - count_up_to(1) => [] - count_up_to(18) => [2,3,5,7,11,13,17] - -""" diff --git a/translation/drafts/97 b/translation/drafts/97 deleted file mode 100644 index e6a5545a..00000000 --- a/translation/drafts/97 +++ /dev/null @@ -1,19 +0,0 @@ -"""Complete the function that takes two integers and returns - the product of their unit digits. - Assume the input is always valid. - Examples: - multiply(148, 412) should return 16. - multiply(19, 28) should return 72. - multiply(2020, 1851) should return 0. - multiply(14,-15) should return 20. - """ - -""" -Ek function banao jo do integers ka input lekar unke unit digits ka product return karega ye function. - Maan lo ki input hamesha valid hoga. - Udaharan: - multiply(148, 412) ka return hoga 16. - multiply(19, 28) ka return hoga 72. - multiply(2020, 1851) ka return hoga 0. - multiply(14,-15) ka return hoga 20. -""" diff --git a/translation/drafts/98 b/translation/drafts/98 deleted file mode 100644 index 67866cbd..00000000 --- a/translation/drafts/98 +++ /dev/null @@ -1,17 +0,0 @@ -""" - Given a string s, count the number of uppercase vowels in even indices. - - For example: - count_upper('aBCdEf') returns 1 - count_upper('abcdefg') returns 0 - count_upper('dBBE') returns 0 - """ - -""" -Diye gaye string s mein, even indices par kitne uppercase vowels hai, unhe count karo. - -Jaise ki: -count_upper('aBCdEf') deta hai 1 -count_upper('abcdefg') deta hai 0 -count_upper('dBBE') deta hai 0 -""" diff --git a/translation/drafts/99 b/translation/drafts/99 deleted file mode 100644 index 5b0b78b7..00000000 --- a/translation/drafts/99 +++ /dev/null @@ -1,35 +0,0 @@ -""" - Create a function that takes a value (string) representing a number - and returns the closest integer to it. If the number is equidistant - from two integers, round it away from zero. - - Examples - >>> closest_integer("10") - 10 - >>> closest_integer("15.3") - 15 - - Note: - Rounding away from zero means that if the given number is equidistant - from two integers, the one you should return is the one that is the - farthest from zero. For example closest_integer("14.5") should - return 15 and closest_integer("-14.5") should return -15. - """ - -""" -Ek function banaiye jo ek value (string) leta hai jo ek number represent karta hai - aur uska sabse pas vala integer return karta hai. Agar number do integers ke beech - samanantar hai, toh use zero se door round karo. - - Udaharan - >>> closest_integer("10") - 10 - >>> closest_integer("15.3") - 15 - - Dhyan Dijiye: - Zero se door round karne ka matlab hai ki agar diya gaya number do integers ke beech - samanantar hai, toh aapko woh integer return karna chahiye jo zero se sabse door hai. - Jaise ki closest_integer("14.5") ko 15 return karna chahiye aur closest_integer("-14.5") - ko -15 return karna chahiye. -"""