Skip to content

Commit

Permalink
translation checks for 106-125 (#44)
Browse files Browse the repository at this point in the history
* Update 106

* Update 107

* Update 108

* Update 112

* Update 116

* Update 119

* Update 120

* fixes

---------

Co-authored-by: Mrigank Pawagi <mrigankpawagi@gmail.com>
  • Loading branch information
sahakintan and mrigankpawagi authored Jan 23, 2024
1 parent 563b3e5 commit 7419750
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 29 deletions.
10 changes: 5 additions & 5 deletions translation/drafts/106
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
"""

"""
Function f ko implement karo jo n ko parameter ke roop mein leta hai,
aur ek list return karta hai jiska size n hota hai, aisa ki index i par element ka value i ka factorial hota hai agar i even hai
ya fir 1 se lekar i tak ke numbers ka sum hota hai otherwise.
i ka start 1 se hota hai.
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]
"""
"""
6 changes: 3 additions & 3 deletions translation/drafts/107
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"""

"""
Ek positive integer n diya gaya hai, return karo ek tuple jisme even aur odd integer palindromes ki sankhya ho jo range(1, n) ke andar aate hain, inclusive.
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:

Expand All @@ -40,6 +40,6 @@ Ek positive integer n diya gaya hai, return karo ek tuple jisme even aur odd int

Dhyan de:
1. 1 <= n <= 10^3
2. returned tuple me even aur odd integer palindromes ki sankhya kramashah hoti hai.
2. returned tuple mei even aur odd integer palindromes respetively ki sankhya hoti hai.

"""
"""
7 changes: 3 additions & 4 deletions translation/drafts/108
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
"""

"""
Ek function likho count_nums jo ek array of integers leta hai aur return karta hai
un elements ki sankhya jinka digits ka sum > 0 hota hai.
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 hote hai -1, 2, aur 3.
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
"""
"""
6 changes: 3 additions & 3 deletions translation/drafts/112
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
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 backward aur forward dono taraf se same padhti ho.
Aapko ek tuple return karna hai jisme resultant string aur True/False check ke liye hoga.
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

"""
"""
9 changes: 4 additions & 5 deletions translation/drafts/116
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@
"""

"""
Is Kata mein, aapko ek array ko sort karna hai jo non-negative integers ka hoga,
binary representation mein ones ki sankhya ke hisaab se ascending order mein.
Agar ones ki sankhya same ho, toh decimal value ke basis par sort karo.
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]
"""
>>> sort_array([1, 0, 2, 3, 4]) == [0, 1, 2, 3, 4]
"""
8 changes: 4 additions & 4 deletions translation/drafts/119
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@

"""
Aapko do strings ki ek list di gayi hai, dono strings me sirf open
parentheses '(' ya close parentheses ')' hi hote hain.
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 tabhi acchi maani jayegi jab usme saare parentheses balanced ho. Jaise ki: string '(())()' acchi hai, jabki string
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, aur anyatha 'No' return karo.
Agar acchi string banane ka koi tarika ho to 'Yes' return karo, anyatha 'No' return karo.

Udaharan:
match_parens(['()(', ')']) == 'Yes'
match_parens([')', ')']) == 'No'
"""
"""
9 changes: 4 additions & 5 deletions translation/drafts/120
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
"""

"""
Ek array arr diya gaya hai integers ka aur ek positive integer k, return karo ek sorted list
lambai k ki maximum k numbers ke saath arr mein.
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:

Expand All @@ -43,7 +42,7 @@ Ek array arr diya gaya hai integers ka aur ek positive integer k, return karo ek
Output: [2]

Note:
1. Array ki lambai range mein hogi [1, 1000].
2. Array ke elements range mein honge [-1000, 1000].
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)
"""
"""

0 comments on commit 7419750

Please sign in to comment.