1. Trang chủ
  2. » Công Nghệ Thông Tin

Báo cáo project 1 copy

287 4 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề Báo cáo project 1 copy
Trường học University of [Your University Name]
Chuyên ngành Computer Science
Thể loại Dự án tốt nghiệp
Năm xuất bản 2023
Thành phố Hà Nội
Định dạng
Số trang 287
Dung lượng 6,55 MB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Câu 1 : Fibonacci 2 Câu 2 : Sum of Digits Digital Root 2 Câu 3 : Fibonacci 3 Câu 4 : Find the next perfect square 4 Câu 5 : Reverse words 5 Câu 6 : Convert number to reversed array of digits 6 Convert number to reversed array of digits 6 Câu 7 : Unique In Order 7 Cau 8 : Bouncing Balls 8 Câu 9 : Dont give me five 10 Dont give me five 10 Câu 10 : Build Tower 11 Câu 11 : String ends with? 13 Câu 12 : Friend or Foe? 13 Câu 13 : Two fighters, one winner. 14 Câu 14: Remove the minimum 16 Câu 15 : Is this a triangle? 17 Câu 16 : Find the capitals 17 Câu 17 : Count the divisors of a number 18 Câu 18 : Sort array by string length 19 Câu 19 : Testing 123 20 Câu 20 : Number of People in the Bus 20 Câu 21 : Odd or Even? 21 Câu 22 : Check the exam 22 Câu 23 : Remove anchor from URL 24 Câu 24 : Anagram Detection 24 Câu 25 : Round up to the next multiple of 5 25 Câu 26 : Youre a square 26 Câu 27 : Maximum Length Difference 27 Câu 28 : Get the Middle Character 28 Câu 29 : Alternate capitalization 29 Câu 30 : Summing a numbers digits 30 Câu 31 : Breaking chocolate problem 31 Câu 32 : Money, Money, Money 32 Câu 33 : Two Oldest Ages 34 Câu 34 : Factorial 35 Câu 35 : Are the numbers in order? 35 Are the numbers in order? 35 Câu 36 : Deodorant Evaporator 37 Câu 37 : Exes and Ohs 37 Câu 38 : Sum of all the multiples of 3 or 5 38 Câu 39 : The Coupon Code 39 Câu 40 : Simple Fun 176: Reverse Letter 40 Câu 41 : Small enough? Beginner 41 Câu 42 : Sum of angles 42 Câu 44 : Make a function that does arithmetic 43 Câu 45 : Fix string case 44 Câu 46 : Sort Numbers 46 Câu 47 : List Filtering 46 Câu 48 : Alphabet war 47 Câu 49 : Descending Order 49 Câu 50 : Count the Digit 49 Câu 51 : Binary Addition 51 Câu 52 : Sum of numbers from 0 to N 51 Câu 53 : Love vs friendship 53 Câu 55 : Highest and Lowest 55 Câu 56 : Maximum Multiple 56 Câu 58 : Printer Errors 58 Câu 59 : Predict your age 59 Câu 60 : Sum of two lowest positive integers 60 Câu 61 : Square Every Digit 61 Câu 62 : Regex validate PIN code 62 Câu 63 : Beginner Series 3 Sum of Numbers 63 Câu 64 : Shortest Word 64 Câu 66 : Jaden Casing Strings 65 Câu 67 : Row Weights 66 Câu 68 : Remove duplicate words 68 Câu 69 : Find the vowels 69 Câu 70 : Sum of a sequence 70 Câu 71 : Volume of a Cuboid 71 Câu 72 : Disemvowel Trolls 72 Câu 73 : Speed Control 72 Câu 74 : Mumbling 74 Câu 75 : Find the stray number 75 Câu 76 : I love you, a little , a lot, passionately ... not at all 76 Câu 77 : Categorize New Member 77 Câu 78 : Greet Me 78 Câu 79 : Sum of Triangular Numbers 79 Câu 80 : Alphabet symmetry 80 Câu 81 : Gauß needs help (Sums of a lot of numbers). 81 Câu 82 : Sum of odd numbers 81 Câu 83 : Thinkful String Drills: Repeater 82 Câu 84 : Isograms 83 Câu 85 : Sort the Gift Code 84 Câu 86 : Largest 5 digit number in a series 85 Câu 87 : Balanced Number (Special Numbers Series 1 ) 86 Câu 88 : Fizz Buzz 87 Câu 89 : Power of two 88 Câu 90 : The highest profit wins 89 Câu 91 : Simple Fun 152: Invite More Women? 90 Câu 92 :Growth of a Population 91 Câu 93 : Bumps in the Road 93 Câu 94 : Moves in squared strings (I) 94 Câu 95 : Number of Decimal Digits 96 Câu 96 : Alphabetical Addition 96 Câu 97 : Build a square 98 Câu 97 : Convert an array of strings to array of numbers 99 Câu 98 : Simple beads count 99 Câu 99 : Ordered Count of Characters 100 Câu 100 : Sum of Cubes 101 Câu 101 : Leap Years 102 Câu 102 : Functional Addition 103 Câu 103 : Averages of numbers 103 Câu 104 : max diff easy 104 Câu 105 : Most digits 105 Câu 106 : My Language Skills 106 Câu 107 : Switcheroo 107 Câu 108 : Find the nth Digit of a Number 108 Câu 109 : Lost number in number sequence 109 Câu 110 : JavaScript Array Filter 109 Câu 111 : Reverse a Number 110 Câu 112 : Largest pair sum in array 111 Câu 113 : Strong Number (Special Numbers Series 2) 112 Câu 114 : Currying functions: multiply all elements in an array 112 Câu 115 : Simple Fun 74: Growing Plant 113 Câu 116 : Disarium Number (Special Numbers Series 3) 116 Câu 117 : Alternate case 117 Câu 118 : Boiled Eggs 118 Câu 119 : Array element parity 119 Câu 120 : Greatest common divisor 120 Câu 121 : Rotate for a Max 121 Câu 122 : A Rule of Divisibility by 7 122 Câu 123 : Going to the cinema 124 Câu 124 : Simple remove duplicates 125 Câu 125 : Sum of array singles 126 Câu 126 : Factorial 127 Câu 127 : Indexed capitalization 127 Câu 128 : Filter the number 128 Câu 129 : Incrementer 129 Câu 130 : Cat and Mouse Easy Version 130 Câu 131 : Complementary DNA 130 Câu 132 : Complete The Pattern 1 131 Câu 133 : Difference Of Squares 133 Câu 134 : Convert a linked list to a string 134 Câu 135 : Narcissistic Numbers 136 Câu 136 : Unlucky Days 137 Câu 137 : Word values 139 Câu 138 : Basic Calculator 140 Câu 139 : Discover The Original Price 141 Câu 140 : All Inclusive? 141 Câu 141 : Expressions Matter 143 Câu 142 : Maximum Product 144 Câu 143 : Parts of a list 145 Câu 144 : Digital cypher 147 Câu 145 : Basic Sequence Practice 149 Câu 146 : All unique 151 Câu 147 : Numbers to Letters 151 Câu 148 : Simple string characters 152 Câu 149 : Sort by Last Char 153 Câu 150 : Compare Strings by Sum of Chars 153 Câu 151 : All Star Code Challenge 22 154 Câu 152 : Digitize 155 Câu 153 : Count all the sheep on farm in the heights of New Zealand 156 Câu 154 : Numbers in strings 157 Câu 155 : Return the first M multiples of N 158 Câu 156 : Recursion 1 Factorial 159 Câu 157 : Even or Odd 159 Câu 158 : The Office II Boredom Score 160 Câu 159 : Split In Parts 161 Câu 160 : Sum of integers in string 162 Câu 162 : Digits explosion 164 Câu 162 : The old switcheroo 165 Câu 163 : Counting Array Elements 166 Câu 164 : Responsible Drinking 167 Câu 165 : Multiply characters 168 Câu 166 : OddEven String Sort 169 Câu 167 : Nth power rules them all 170 Câu 168 : Drying Potatoes 171 Câu 169 : Average Scores 172 Câu 170 : Return the closest number multiple of 10 172 Câu 171 : Smallest value of an array 173 Câu 172 : The wheatrice and chessboard problem 174 Câu 172 : Building blocks 175 Câu 174 : Substituting Variables Into Strings: Padded Numbers 177 Câu 175 : Case Swapping 178 Câu 176 : Looking for a benefactor 178 Câu 177 : Basic Math (Add or Subtract) 180 Câu 178 : SevenAte9 181 Câu 179 : Clean up after your dog 181 Câu 180 : Say hello 183 Câu 181 : Reverse the bits in an integer 183 Câu 182 : Unique string characters 184 Câu 183 : Regexp Basics is it a vowel? 185 Câu 184 : Find the lucky numbers 186 Câu 185 : Simple Fun 2: Circle of Numbers 186 Câu 186 : By 3, or not by 3? That is the question . . . 188 Câu 187 : Last Survivor 189 Câu 188 : Building Strings From a Hash 190 Câu 189 : Number Of Occurrences 191 Câu 190 : Exclamation marks series 13: Count the number of exclamation marks and question marks, return the product 191 Câu 191 : Simple Fun 37: House Numbers Sum 192 Câu 192 : Interview Question (easy) 194 Câu 193 : Credit card issuer checking 197 Câu 194 : Valid Spacing 198 Câu 195 : Simple string reversal 199 Câu 196 : Letterbox PaintSquad 200 Câu 197 : Check three and two 202 Câu 198 : Character Counter 203 Câu 199 : Inspiring Strings 204 Câu 200 : Complete The Pattern 2 205 Câu 201 : makeBackronym 207 back·ro·nym 207 Câu 202 : Remove All The Marked Elements of a List 208 Câu 203 : Evens times last 209 Câu 204 : Insert dashes 210 Câu 205 : Initialize my name 211 Câu 206 : Computer problem series 1: Fill the Hard Disk Drive 212 Câu 207 : getNames() 213 Câu 208 : Nice Array 214 Câu 209 : Enumerable Magic 5 True for Just One? 216 Câu 210 : Holiday III Fire on the boat 216 Câu 211 : Volume of a Cuboid 217 Câu 212 : Reverse words 217 Câu 214 : Find the next perfect square 218 Câu 215 : Ones and Zeros 219 Câu 216 : Flatten and sort an array 220 Câu 217 : Coding Meetup 1 HigherOrder Functions Series Count the number of JavaScript developers coming from Europe 221 Câu 218 : Coloured Triangles 222 219 : Char Code Calculation 223 Câu 220 : Spacify 224 Câu 222 : The Office I Outed 226 Câu 223 : Coding Meetup 2 HigherOrder Functions Series Greet developers 226 Câu 234 : Simple consecutive pairs 228 Câu 225 : Halving Sum 229 Câu 227 : Squares sequence 230 Câu 228 : Count the Characters 230 Câu 229 : Dont give me five 231 Dont give me five 231 Câu 230 : Series of integers from m to n 232 Câu 231 : Volume of a Cuboid 232 Câu 233 : The Office IV Find a Meeting Room 233 Câu 234 : Help the Fruit Guy 234 Câu 235 : Sort arrays 1 234 Câu 236 : Covfefe 235 Câu 237 : ATM 235 Câu 238 : Double Sort 236 Câu 239 : 16+18=214 237 Câu 240 : Broken sequence 238 Câu 241 : Replace every nth 239 Câu 242 : How many arguments 240 Câu 243 : Formatting decimal places 1 241 Câu 244 : Summy 241 Câu 245 : Find Screen Size 242 The Challenge 242 Câu 246 : Find Count of Most Frequent Item in an Array 243 Câu 247 : Remove consecutive duplicate words 243 Câu 248 : Find all pairs 244 Câu 249 : Correct the timestring 245 Câu 250 : Bingo ( Or Not ) 246 Câu 251 : Spoonerize Me 247 Câu 252 : Stanton measure 248 Câu 253 : Arithmetic progression 248 Câu 254 : Numbers with this digit inside 249 Câu 255 : String Merge 250 Câu 256 : lucky number 251 Câu 257 : Scaling Squared Strings 251 Câu 258 : Maxmin arrays 253 Câu 259 : Plus minus plus plus ... Count 254 Câu 260 : Pandemia

Trang 1

Câu 1 : Fibonacci 2

Câu 2 : Sum of Digits / Digital Root 2

Câu 3 : Fibonacci 3

Câu 4 : Find the next perfect square! 4

Câu 5 : Reverse words 5

Câu 6 : Convert number to reversed array of digits 6

Convert number to reversed array of digits 6

Câu 7 : Unique In Order 7

Cau 8 : Bouncing Balls 8

Câu 9 : Don't give me five! 10

Don't give me five! 10

Câu 10 : Build Tower 11

Câu 11 : String ends with? 13

Câu 12 : Friend or Foe? 13

Câu 13 : Two fighters, one winner 14

Câu 14: Remove the minimum 16

Câu 15 : Is this a triangle? 17

Câu 16 : Find the capitals 17

Câu 17 : Count the divisors of a number 18

Câu 18 : Sort array by string length 19

Câu 19 : Testing 1-2-3 20

Câu 20 : Number of People in the Bus 20

Câu 21 : Odd or Even? 21

Câu 22 : Check the exam 22

Câu 23 : Remove anchor from URL 24

Câu 24 : Anagram Detection 24

Câu 25 : Round up to the next multiple of 5 25

Câu 26 : You're a square! 26

Câu 27 : Maximum Length Difference 27

Câu 28 : Get the Middle Character 28

Câu 29 : Alternate capitalization 29

Câu 30 : Summing a number's digits 30

Câu 31 : Breaking chocolate problem 31

Câu 32 : Money, Money, Money 32

Câu 33 : Two Oldest Ages 34

Trang 2

Câu 34 : Factorial 35

Câu 35 : Are the numbers in order? 35

Are the numbers in order? 35

Câu 36 : Deodorant Evaporator 37

Câu 37 : Exes and Ohs 37

Câu 38 : Sum of all the multiples of 3 or 5 38

Câu 39 : The Coupon Code 39

Câu 40 : Simple Fun #176: Reverse Letter 40

Câu 41 : Small enough? - Beginner 41

Câu 42 : Sum of angles 42

Câu 44 : Make a function that does arithmetic! 43

Câu 45 : Fix string case 44

Câu 46 : Sort Numbers 46

Câu 47 : List Filtering 46

Câu 48 : Alphabet war 47

Câu 49 : Descending Order 49

Câu 50 : Count the Digit 49

Câu 51 : Binary Addition 51

Câu 52 : Sum of numbers from 0 to N 51

Câu 53 : Love vs friendship 53

Câu 55 : Highest and Lowest 55

Câu 56 : Maximum Multiple 56

Câu 58 : Printer Errors 58

Câu 59 : Predict your age! 59

Câu 60 : Sum of two lowest positive integers 60

Câu 61 : Square Every Digit 61

Câu 62 : Regex validate PIN code 62

Câu 63 : Beginner Series #3 Sum of Numbers 63

Câu 64 : Shortest Word 64

Câu 66 : Jaden Casing Strings 65

Câu 67 : Row Weights 66

Câu 68 : Remove duplicate words 68

Câu 69 : Find the vowels 69

Câu 70 : Sum of a sequence 70

Câu 71 : Volume of a Cuboid 71

Câu 72 : Disemvowel Trolls 72

Câu 73 : Speed Control 72

Trang 3

Câu 74 : Mumbling 74

Câu 75 : Find the stray number 75

Câu 76 : I love you, a little , a lot, passionately not at all 76

Câu 77 : Categorize New Member 77

Câu 78 : Greet Me 78

Câu 79 : Sum of Triangular Numbers 79

Câu 80 : Alphabet symmetry 80

Câu 81 : Gauß needs help! (Sums of a lot of numbers) 81

Câu 82 : Sum of odd numbers 81

Câu 83 : Thinkful - String Drills: Repeater 82

Câu 84 : Isograms 83

Câu 85 : Sort the Gift Code 84

Câu 86 : Largest 5 digit number in a series 85

Câu 87 : Balanced Number (Special Numbers Series #1 ) 86

Câu 88 : Fizz Buzz 87

Câu 89 : Power of two 88

Câu 90 : The highest profit wins! 89

Câu 91 : Simple Fun #152: Invite More Women? 90

Câu 92 :Growth of a Population 91

Câu 93 : Bumps in the Road 93

Câu 94 : Moves in squared strings (I) 94

Câu 95 : Number of Decimal Digits 96

Câu 96 : Alphabetical Addition 96

Câu 97 : Build a square 98

Câu 97 : Convert an array of strings to array of numbers 99

Câu 98 : Simple beads count 99

Câu 99 : Ordered Count of Characters 100

Câu 100 : Sum of Cubes 101

Câu 101 : Leap Years 102

Câu 102 : Functional Addition 103

Câu 103 : Averages of numbers 103

Câu 104 : max diff - easy 104

Câu 105 : Most digits 105

Câu 106 : My Language Skills 106

Câu 107 : Switcheroo 107

Câu 108 : Find the nth Digit of a Number 108

Câu 109 : Lost number in number sequence 109

Trang 4

Câu 110 : JavaScript Array Filter 109

Câu 111 : Reverse a Number 110

Câu 112 : Largest pair sum in array 111

Câu 113 : Strong Number (Special Numbers Series #2) 112

Câu 114 : Currying functions: multiply all elements in an array 112

Câu 115 : Simple Fun #74: Growing Plant 113

Câu 116 : Disarium Number (Special Numbers Series #3) 116

Câu 117 : Alternate case 117

Câu 118 : Boiled Eggs 118

Câu 119 : Array element parity 119

Câu 120 : Greatest common divisor 120

Câu 121 : Rotate for a Max 121

Câu 122 : A Rule of Divisibility by 7 122

Câu 123 : Going to the cinema 124

Câu 124 : Simple remove duplicates 125

Câu 125 : Sum of array singles 126

Câu 126 : Factorial 127

Câu 127 : Indexed capitalization 127

Câu 128 : Filter the number 128

Câu 129 : Incrementer 129

Câu 130 : Cat and Mouse - Easy Version 130

Câu 131 : Complementary DNA 130

Câu 132 : Complete The Pattern #1 131

Câu 133 : Difference Of Squares 133

Câu 134 : Convert a linked list to a string 134

Câu 135 : Narcissistic Numbers 136

Câu 136 : Unlucky Days 137

Câu 137 : Word values 139

Câu 138 : Basic Calculator 140

Câu 139 : Discover The Original Price 141

Câu 140 : All Inclusive? 141

Câu 141 : Expressions Matter 143

Câu 142 : Maximum Product 144

Câu 143 : Parts of a list 145

Câu 144 : Digital cypher 147

Câu 145 : Basic Sequence Practice 149

Câu 146 : All unique 151

Trang 5

Câu 147 : Numbers to Letters 151

Câu 148 : Simple string characters 152

Câu 149 : Sort by Last Char 153

Câu 150 : Compare Strings by Sum of Chars 153

Câu 151 : All Star Code Challenge #22 154

Câu 152 : Digitize 155

Câu 153 : Count all the sheep on farm in the heights of New Zealand 156

Câu 154 : Numbers in strings 157

Câu 155 : Return the first M multiples of N 158

Câu 156 : Recursion #1 - Factorial 159

Câu 157 : Even or Odd 159

Câu 158 : The Office II - Boredom Score 160

Câu 159 : Split In Parts 161

Câu 160 : Sum of integers in string 162

Câu 162 : Digits explosion 164

Câu 162 : The old switcheroo 165

Câu 163 : Counting Array Elements 166

Câu 164 : Responsible Drinking 167

Câu 165 : Multiply characters 168

Câu 166 : Odd-Even String Sort 169

Câu 167 : Nth power rules them all! 170

Câu 168 : Drying Potatoes 171

Câu 169 : Average Scores 172

Câu 170 : Return the closest number multiple of 10 172

Câu 171 : Smallest value of an array 173

Câu 172 : The wheat/rice and chessboard problem 174

Câu 172 : Building blocks 175

Câu 174 : Substituting Variables Into Strings: Padded Numbers 177

Câu 175 : Case Swapping 178

Câu 176 : Looking for a benefactor 178

Câu 177 : Basic Math (Add or Subtract) 180

Câu 178 : SevenAte9 181

Câu 179 : Clean up after your dog 181

Câu 180 : Say hello! 183

Câu 181 : Reverse the bits in an integer 183

Câu 182 : Unique string characters 184

Câu 183 : Regexp Basics - is it a vowel? 185

Trang 6

Câu 184 : Find the lucky numbers 186

Câu 185 : Simple Fun #2: Circle of Numbers 186

Câu 186 : By 3, or not by 3? That is the question 188

Câu 187 : Last Survivor 189

Câu 188 : Building Strings From a Hash 190

Câu 189 : Number Of Occurrences 191

Câu 190 : Exclamation marks series #13: Count the number of exclamation marks and question marks, return the product 191

Câu 191 : Simple Fun #37: House Numbers Sum 192

Câu 192 : Interview Question (easy) 194

Câu 193 : Credit card issuer checking 197

Câu 194 : Valid Spacing 198

Câu 195 : Simple string reversal 199

Câu 196 : Letterbox Paint-Squad 200

Câu 197 : Check three and two 202

Câu 198 : Character Counter 203

Câu 199 : Inspiring Strings 204

Câu 200 : Complete The Pattern #2 205

Câu 201 : makeBackronym 207

back·ro·nym 207

Câu 202 : Remove All The Marked Elements of a List 208

Câu 203 : Evens times last 209

Câu 204 : Insert dashes 210

Câu 205 : Initialize my name 211

Câu 206 : Computer problem series #1: Fill the Hard Disk Drive 212

Câu 207 : getNames() 213

Câu 208 : Nice Array 214

Câu 209 : Enumerable Magic #5- True for Just One? 216

Câu 210 : Holiday III - Fire on the boat 216

Câu 211 : Volume of a Cuboid 217

Câu 212 : Reverse words 217

Câu 214 : Find the next perfect square! 218

Câu 215 : Ones and Zeros 219

Câu 216 : Flatten and sort an array 220

Câu 217 : Coding Meetup #1 - Higher-Order Functions Series - Count the number of JavaScript developers coming from Europe 221

Câu 218 : Coloured Triangles 222

219 : Char Code Calculation 223

Trang 7

Câu 220 : Spacify 224

Câu 222 : The Office I - Outed 226

Câu 223 : Coding Meetup #2 - Higher-Order Functions Series - Greet developers .226 Câu 234 : Simple consecutive pairs 228

Câu 225 : Halving Sum 229

Câu 227 : Squares sequence 230

Câu 228 : Count the Characters 230

Câu 229 : Don't give me five! 231

Don't give me five! 231

Câu 230 : Series of integers from m to n 232

Câu 231 : Volume of a Cuboid 232

Câu 233 : The Office IV - Find a Meeting Room 233

Câu 234 : Help the Fruit Guy 234

Câu 235 : Sort arrays - 1 234

Câu 236 : Covfefe 235

Câu 237 : ATM 235

Câu 238 : Double Sort 236

Câu 239 : 16+18=214 237

Câu 240 : Broken sequence 238

Câu 241 : Replace every nth 239

Câu 242 : How many arguments 240

Câu 243 : Formatting decimal places #1 241

Câu 244 : Summy 241

Câu 245 : Find Screen Size 242

The Challenge 242

Câu 246 : Find Count of Most Frequent Item in an Array 243

Câu 247 : Remove consecutive duplicate words 243

Câu 248 : Find all pairs 244

Câu 249 : Correct the time-string 245

Câu 250 : Bingo ( Or Not ) 246

Câu 251 : Spoonerize Me 247

Câu 252 : Stanton measure 248

Câu 253 : Arithmetic progression 248

Câu 254 : Numbers with this digit inside 249

Câu 255 : String Merge! 250

Câu 256 : lucky number 251

Câu 257 : Scaling Squared Strings 251

Trang 8

Câu 258 : Max-min arrays 253

Câu 259 : Plus - minus - plus - plus - - Count 254

Câu 260 : Pandemia � 254

Câu 261 : Calculate mean and concatenate string 256

Câu 262 : The fusc function Part 1 257

Câu 263 : The Office III - Broken Photocopier 258

Câu 265 : Last 259

Câu 266 : Is n divisible by ( )? 259

Câu 267 : "Very Even" Numbers 260

Câu 268 : Thinking & Testing: A and B? 261

Câu269 : Linked Lists - Push & BuildOneTwoThree 261

Câu 270 : Number-Star ladder 262

Câu 271 : Powers of 2 264

Câu 272 : Even numbers in an array 264

Câu 273 : Coding Meetup #3 - Higher-Order Functions Series - Is Ruby coming? 265

Câu 274 : Coding Meetup #11 - Higher-Order Functions Series - Find the average age 266

Câu 275 : Coding Meetup #5 - Higher-Order Functions Series - Prepare the count of languages 267

Câu 276 : Debug Sum of Digits of a Number 268

Câu 277 : Divide and Conquer 269

Câu 278 : V A P O R C O D E 269

Câu 279 : Sum even numbers 270

Câu 280 : All Star Code Challenge #3 270

Câu 281 : Coding Meetup #6 - Higher-Order Functions Series - Can they code in the same language? 271

Câu 282 : Nth Root of a Number 272

Câu 283 : Consecutive items 272

Câu 284 : Head, Tail, Init and Last 273

Câu 285 : Find min and max 275

Câu 286 : Find Nearest square number 275

Câu 287 : Find the middle element 275

Câu 288 : Consecutive Vowels in a String 276

Câu 289 : CSV representation of array 277

Câu 290 : Add property to every object in array 278

Câu 291 : Rock Paper Scissors! 279

Câu 292 : Help Suzuki complete his chores! 280

Câu 293 : Scrabble Score 281

Trang 9

Câu 294 : Merge two sorted arrays into one 282

Câu 295 : The fusc function Part 1 283

Câu 296 : Dot Calculator 284

Câu 297 : Find Nearest square number 285

Câu 298 : Powers of 2 285

Câu 299 : L1: Set Alarm 286

Câu 300 : Tổng số điểm 287

Câu 1 : Fibonacci

Create function fib that returns n'th element of Fibonacci sequence (classic

programming task).

INPUT : nhập số n

OUTPUT : in ra dãy fibonacci

B1 : khai báo f0 = 0 , f1 = 1 , fn = 1

B2 : nếu n < 0 trả về -1 , n = 0 hoặc n = 1 thì trả về n

B3 : nếu n > 2 thì thực hiện vòng lặp for

gán f0 = f1 , f1 = fn , fn = f0 + f1 và trả về fn kết thức thuật toán

Trang 10

Câu 2 : Sum of Digits / Digital Root

Given n, take the sum of the digits of n If that value has more than one digit, continue reducing in this way until a single-digit number is produced.The input will be a non-negative integer

OUTPUT : tính tổng các chữ số của n cho đến khi tổng là 1 số nhỏ hơn 10

B1 : khai báo sum , reminder

B2 : thực hiện vòng lặp while với number > 0 thì reminder = number % 10

sum = reminder + sum

number = number / 10

Trang 11

B3 : sử dụng if với sum > 9 thì thực hiện lại bước 2 , kết thúc thuật toán

Câu 3 : Fibonacci

Create function fib that returns n'th element of Fibonacci sequence (classic programming task).

INPUT : nhập vào int n

OUTPUT : trả về chuỗi phần tử n của chuỗi fib

Câu 4 : Find the next perfect

square!

You might know some pretty large perfect squares But what about the NEXT one?

Trang 12

Complete the findNextSquare method that finds the next integral perfect square after the one passed as a parameter Recall that an integral perfectsquare is an integer n such that sqrt(n) is also an integer.

If the parameter is itself not a perfect square then -1 should be returned You may assume the parameter is non-negative

B2 : nếu n > 0 thì lấy căn của n + 1 , sau đó gán vào a

B3 : bình phương a , sau đó gán vào b

B4 : in ra b ,kết thúc thuật toán

Câu 5 : Reverse words

Trang 13

Complete the function that accepts a string parameter, and reverses each

word in the string All spaces in the string should be retained.

Examples

"This is an example!" ==> "sihT si na !elpmaxe"

"double spaces" ==> "elbuod secaps"

INPUT : nhập chuỗi string

OUTPUT : đảo ngước từng chữ trong chuỗi string

B1 : nhập chuỗi string

B2 : khai báo mảng xauArray kiểu char để tách từ trong chuỗi

B3 : tạo đối tượng reverve đầu vào xauArray sau đó trả về reverve , kết thúc thuật toán

Câu 6 : Convert number to

reversed array of digits

Convert number to reversed array of digits

Given a random non-negative number, you have to return the digits of thisnumber within an array in reverse order

Trang 14

Example(Input => Output):

348597 => [7,9,5,8,4,3]

0 => [0]

Câu 7 : Unique In Order

Implement the function unique_in_order which takes as argument a sequence and returns a list of items without any elements with the same value next to each other and preserving the original order of elements.For example:

Trang 15

uniqueInOrder("AAAABBBCCDAABBB") == {'A', 'B', 'C', 'D', 'A', 'B'} uniqueInOrder("ABBCcAD") == {'A', 'B', 'C', 'c', 'A', 'D'} uniqueInOrder([1,2,2,3,3]) == {1,2,3}

INPUT : nhập chuỗi string inputString

OUTPUT : trả về mảng loại bỏ các kí tự trùng lặp

B1 : khai báo chuỗi string inputString , resultString

B2 : thực hiện vòng lặp for => sử dụng if với !resultString.Contains(inputString[i]) thì resultString +=inputString[i] + ‘’,”

B4 : trả về , kết thúc thuật toán

Cau 8 : Bouncing Balls

Trang 16

A child is playing with a ball on the nth floor of a tall building The height of

this floor, h, is known.

He drops the ball out of the window The ball bounces (for example), to two-thirds of its height (a bounce of 0.66)

His mother looks out of a window 1.5 meters from the ground

How many times will the mother see the ball pass in front of her window

(including when it's falling and bouncing?

Three conditions must be met for a valid experiment:

 Float parameter "h" in meters must be greater than 0

 Float parameter "bounce" must be greater than 0 and less than 1

 Float parameter "window" must be less than h.

If all three conditions above are fulfilled, return a positive integer, otherwise return -1.

Note:

The ball can only be seen if the height of the rebounding ball is

strictly greater than the window parameter.

Examples:

- h = 3, bounce = 0.66, window = 1.5, result is 3

- h = 3, bounce = 1, window = 1.5, result is -1

(Condition 2) not fulfilled).

Trang 17

INPUT : nhập h , bounce = 0.66 , window = 1.5

OUTPUT : số lần người mẹ thấy bóng sau khi bóng rơi

B1 : nhập h , bounce = 0.66 , window = 1.5

B2 : thực hiện vòng lặp while () , mỗi lần bóng rơi thì gán lại chiều cao h và tính được số lần nhìn thấy bóng qua cửa số kết thức thuật toánp

Câu 9 : Don't give me five!

Don't give me five!

In this kata you get the start number and the end number of a region and should return the count of all numbers except numbers with a 5 in it The start and the end number are both inclusive!

Examples:

1,9 -> 1,2,3,4,6,7,8,9 -> Result 8

4,17 -> 4,6,7,8,9,10,11,12,13,14,16,17 -> Result 12

The result may contain fives ;-)

The start number will always be smaller than the end number Both

numbers can be also negative!

I'm very curious for your solutions and the way you solve it Maybe

someone of you will find an easy pure mathematics solution

Trang 18

Have fun coding it and please don't forget to vote and rank this kata! :-)

I have also created other katas Take a look if you enjoyed this kata!

INPUT : nhập 2 số nguyên dương

OUTPUT : tính số các số trong khoảng 2 số

B1 : khai báo biến tổng

B2 :thực hiện vòng lặp for

B3 : nếu thực hiện đến số 5 , loại bỏ đi số 5 và tiếp tục thực hiên vòng lặp , kết thúc thuật toán

Câu 10 : Build Tower

Build Tower

Build a pyramid-shaped tower given a positive integer number of floors Atower block is represented with "*" character

Trang 19

For example, a tower with 3 floors looks like this:

Trang 20

INPUT :nhập vào nFloors

OUTPUT : trả về hình tháp

B1 : khai báo danh sách List <string> primes

B2 : thực hiện vòng lặp for

Câu 11 : String ends with?

Complete the solution so that it returns true if the first argument(string) passed in ends with the 2nd argument (also a string)

Examples:

solution('abc', 'bc') // returns true

solution('abc', 'd') // returns false

INPUT : nhập 2 chuỗi string

OUTPUT : trả về true false so sánh chuỗi string 2 là chuỗi kết thúc của chuỗi string 1

B1 : sử dụng hàm contains để so sánh str và ending

Trang 21

Câu 12 : Friend or Foe?

Make a program that filters a list of strings and returns a list with only yourfriends name in it

If a name has exactly 4 letters in it, you can be sure that it has to be a friend of yours! Otherwise, you can be sure he's not

Ex: Input = ["Ryan", "Kieran", "Jason", "Yous"], Output = ["Ryan", "Yous"]i.e

friend ["Ryan", "Kieran", "Mark"] `shouldBe` ["Ryan", "Mark"]

INPUT : nhập vào mảng string

OUTPUT : trả về mảng string tên có 4 chữ cái

B1 : khai báo mảng listOfFriends

B2 : thực hiện vòng lặp foreach , nếu độ dài của mảng là 4 thì add vào listOfFriend ,trả về

listOfFriend , kết thúc thuật toán

Câu 13 : Two fighters, one winner.

Create a function that returns the name of the winner in a fight between two fighters

Trang 22

Each fighter takes turns attacking the other and whoever kills the other first is victorious Death is defined as having health <= 0.

Each fighter will be a Fighter object/instance See the Fighter class below

in your chosen language

Both health and damagePerAttack (damage_per_attack for python) will be integers larger than 0 You can mutate the Fighter objects

Example:

declare_winner(Fighter("Lew", 10, 2), Fighter("Harry", 5, 4), "Lew") =>

"Lew"

Lew attacks Harry; Harry now has 3 health.

Harry attacks Lew; Lew now has 6 health.

Lew attacks Harry; Harry now has 1 health.

Harry attacks Lew; Lew now has 2 health.

Lew attacks Harry: Harry now has -1 health and is dead Lew wins.

public class Fighter {

public string Name;

public int Health, DamagePerAttack;

public Fighter(string name, int health, int damagePerAttack) {

Trang 23

INPUT : 2 võ sĩ và dame của 2 võ sĩ

OUTPUT : trả về người thắng giữa 2 võ sĩ

Câu 14: Remove the minimum

The museum of incredible dull things

The museum of incredible dull things wants to get rid of some exhibitions Miriam, the interior architect, comes up with a plan to remove the most boring exhibitions She gives them a rating, and then removes the one with the lowest rating

However, just as she finished rating all exhibitions, she's off to an

important fair, so she asks you to write a program that tells her the ratings

of the items after one removed the lowest one Fair enough

Task

Given an array of integers, remove the smallest value Do not mutate the original array/list If there are multiple elements with the same value, remove the one with a lower index If you get an empty array/list, return an empty array/list

Don't change the order of the elements that are left

Examples

* Input: [1,2,3,4,5], output= [2,3,4,5]

* Input: [5,3,2,1,4], output = [5,3,2,4]

* Input: [2,2,1,2,1], output = [2,2,2,1]

Trang 24

INPUT : nhập vào mảng số

OUTPUT : in ra mảng số loại đi số nhỏ nhất trong mảng

B1 : thực hiện câu lệnh điều kiện if , sử dụng hàm remove để lạo bỏ số min có trong mảng , kết thúc thuật toán

Câu 15 : Is this a triangle?

Câu Implement a function that accepts 3 integer values a, b, c The

function should return true if a triangle can be built with the sides of given length and false in any other case

(In this case, all triangles must have surface greater than 0 to be

accepted)

INPUT : nhập độ dài 3 cạnh của tam giác

OUTPUT : trả về true hoặc false nếu 3 cạnh đó hợp thành 1 tam giác

B1 : trả về điều kiện a + b >c ,b + c > a , a +c > b

Câu 16 : Find the capitals

Trang 25

Write a function that takes a single string (word) as argument The function must return an ordered list containing the indexes of all capital letters in the string.

Example

Assert.AreEqual(Kata.Capitals("CodEWaRs"), new int[]{0,3,4,6});

INPUT : nhập vào chuỗi string

OUTPUT : trả về số thứ tự của kí tự in hoa

B1 : khai báo mảng List

Trang 26

30 > 8 (1, 2, 3, 5, 6, 10, 15, 30)

INPUT : nhập số n

OUTPUT : trả về số ước của số n

B1 : khai báo thuộc tính numberOfDivisors

B2 : thực hiện vòng lặp for

B3 : sử dụng câu điều kiện if , nếu n chia hết cho i thì cộng thêm vào numberOfDivisors

B4 : trả về numberOfDivisors , kết thúc thuật toán

Câu 18 : Sort array by string

length

Write a function that takes an array of strings as an argument and returns

a sorted array containing the same strings, ordered from shortest to

longest

For example, if this array were passed as an argument:

["Telescopes", "Glasses", "Eyes", "Monocles"]

Your function would return the following array:

["Eyes", "Glasses", "Monocles", "Telescopes"]

All of the strings in the array passed to your function will be different lengths, so you will not have to decide how to order multiple strings of the

Trang 27

same length.

INPUT : nhập vào mảng string

OUTPUT : trả về mảng sắp xếp chuỗi string từ ngắn nhất đến dài nhất

Câu 19 : Testing 1-2-3

Your team is writing a fancy new text editor and you've been tasked with implementing the line numbering

Write a function which takes a list of strings and returns each line

prepended by the correct number

The numbering starts at 1 The format is n: string Notice the colon and space in between

Examples:

number(List<string>()) // => List<string>()

number(List<string>{"a", "b", "c"}) // => ["1: a", "2: b", "3: c"]

Trang 28

INPUT : nhập vào mảng List

OUTPUT : in ra mảng chứa số thứ tự của từng chuỗi string có trong mảng

of people get off the bus (The second item) in a bus stop

Your task is to return number of people who are still in the bus after the last bus station (after the last array) Even though it is the last bus stop, the bus is not empty and some people are still in the bus, and they are probably sleeping there :D

Take a look on the test cases

Please keep in mind that the test cases ensure that the number of people

in the bus is always >= 0 So the return integer can't be negative

The second value in the first integer array is 0, since the bus is empty in the first bus stop

Trang 29

Câu 21 : Odd or Even?

Given a list of integers, determine whether the sum of its elements is odd

or even

Give your answer as a string matching "odd" or "even"

If the input array is empty consider it as: [0] (array with a zero)

Trang 30

INPUT : nhập vào 1 mảng

OUTPUT : trả về tổng các phần tử trong mảng là even hoặc odd

B1 : khai báo thuộc tính result

B2 : thực hiện vòng lặp foreach

B3 : cộng các phần tử với nhau

B4 : trả về even nếu result mod 2 = 0 , odd nếu result mod 2 = 1 , kết thúc thuật toán

Câu 22 : Check the exam

The first input array is the key to the correct answers to an exam, like ["a",

"a", "b", "d"] The second one contains a student's submitted answers

The two arrays are not empty and are the same length Return the score for this array of answers, giving +4 for each correct answer, -1 for each incorrect answer, and +0 for each blank answer, represented as an empty string (in C the space character is used)

If the score < 0, return 0

For example:

checkExam(["a", "a", "b", "b"], ["a", "c", "b", "d"]) → 6

checkExam(["a", "a", "c", "b"], ["a", "a", "b", ""]) → 7

checkExam(["a", "a", "b", "c"], ["a", "a", "b", "c"]) → 16

checkExam(["b", "c", "b", "a"], ["", "a", "a", "c"]) → 0

Trang 31

INPUT : nhập vào 2 mảng arr1 đáp án đúng , arr2 đáp án của sinh viên

OUTPUT : trả về số điểm của sinh viên

B1 : khai báo hàm tính điểm count

B2 : thực hiện vòng lặp for

B3 : nếu arr2[i] rỗng thì bỏ qua

B4 : nếu arr2[i] = arr1[i] thì count +=4

B5 : nếu không thuộc 2 trường hợp trên count -= 1

B6 : nếu count < 0 thì trả về count = 0

B7 : trả về count , kết thúc thuật toán

Câu 23 : Remove anchor from URL

Complete the function/method so that it returns the url with anything afterthe anchor (#) removed

Examples

"www.codewars.com#about" > "www.codewars.com"

"www.codewars.com?page=1" >"www.codewars.com?page=1"

Trang 32

INPUT : nhập vào chuỗi string url

OUTPUT : trả về chuỗi string được loại bỏ #

B1 : trả về url , sử dụng hàm Split cắt chuỗi string ở vị trí “#”

Câu 24 : Anagram Detection

An anagram is the result of rearranging the letters of a word to produce a

new word (see wikipedia)

Note: anagrams are case insensitive

Complete the function to return true if the two arguments given are

anagrams of each other; return false otherwise

Examples

 "foefet" is an anagram of "toffee"

 "Buckethead" is an anagram of "DeathCubeK"

Trang 33

Câu 25 : Round up to the next

Trang 34

B3 : trả về n , kết thúc thuật toán

Câu 26 : You're a square!

A square of squares

You like building blocks You especially like building blocks that are

squares And what you even like more, is to arrange them into a square of square building blocks!

However, sometimes, you can't arrange them into a square Instead, you end up with an ordinary rectangle! Those blasted things! If you just had a way to know, whether you're currently working in vain… Wait! That's it!

You just have to check if your number of building blocks is a perfect

square.

Task

Given an integral number, determine if it's a square number:

In mathematics, a square number or perfect square is an integer that

is the square of an integer; in other words, it is the product of some

integer with itself.

The tests will always use some integral number, so don't worry about that

in dynamic typed languages

Trang 35

Find max(abs(length(x) − length(y)))

If a1 and/or a2 are empty return -1 in each language except in Haskell (F#) where you will return Nothing (None)

 input : 2 strings with substrings separated by ,

 output: number as a string

INPUT : 2 chuỗi với các chuỗi con được phân tách bởi “,”

OUTPUT : số dưới dạng chuỗi

Trang 36

Câu 28 : Get the Middle Character

You are going to be given a word Your job is to return the middle character

of the word If the word's length is odd, return the middle character If the word's length is even, return the middle 2 characters

#Examples:

Kata.getMiddle("test") should return "es"

Kata.getMiddle("testing") should return "t"

Kata.getMiddle("middle") should return "dd"

Kata.getMiddle("A") should return "A"

Trang 37

Câu 29 : Alternate capitalization

Given a string, capitalize the letters that occupy even indexes and odd indexes separately, and return as shown below Index 0 will be consideredeven

For example, capitalize("abcdef") = ['AbCdEf', 'aBcDeF'] See test casesfor more examples

The input will be a lowercase string with no spaces

Good luck!

If you like this Kata, please try:

Indexed capitalization

Even-odd disparity

INPUT : nhập vào chuỗi string s

OUTPUT : trả về mảng chuỗi r1 in hoa các chữ cái ở vị trí chẵn và r2 in hoa chũ cái ở vị trí lẻ

Trang 38

Write a function named sumDigits which takes a number as input and returns the sum of the absolute value of each of the number's decimal digits.

For example: (Input > Output)

10 > 1

99 > 18

-32 > 5

Let's assume that all numbers in the input will be integer values

INPUT : nhập vào số number

OUTPUT : trả về tổng giá trị tuyệt đối của mỗi chữ số thập phân trong number

B1 : sử dụng if nếu number < 0 thì number * (-1)

B2 : sử dụng if nếu number =0 thì trả về 0

B3 : thực hiện tính tổng các chữ số trong số bằng cách lấy tách các chữ số number % 10 và

SumDigits( number /10 ) , kết thúc thuật toán

Câu 31 : Breaking chocolate

problem

Your task is to split the chocolate bar of given dimension n x m into small squares Each square is of size 1x1 and unbreakable Implement a functionthat will return minimum number of breaks needed

For example if you are given a chocolate bar of size 2 x 1 you can split it

to single squares in just one break, but for size 3 x 1 you must do two breaks

Trang 39

If input data is invalid you should return 0 (as in no breaks are needed if

we do not have any chocolate to split) Input will always be a non-negativeinteger

Câu 32 : Money, Money, Money

Mr Scrooge has a sum of money 'P' that he wants to invest Before he does, he wants to know how many years 'Y' this sum 'P' has to be kept in the bank in order for it to amount to a desired sum of money 'D'

The sum is kept for 'Y' years in the bank where interest 'I' is paid yearly After paying taxes 'T' for the year the new sum is re-invested

Note to Tax: not the invested principal is taxed, but only the year's accruedinterest

Example:

Trang 40

Let P be the Principal = 1000.00

Let I be the Interest Rate = 0.05

Let T be the Tax Rate = 0.18

Let D be the Desired Sum = 1100.00

Thus Mr Scrooge has to wait for 3 years for the initial principal to amount

to the desired sum

Your task is to complete the method provided and return the number of years 'Y' as a whole in order for Mr Scrooge to get the desired sum

Assumption: Assume that Desired Principal 'D' is always greater than the initial principal However it is best to take into consideration that if DesiredPrincipal 'D' is equal to Principal 'P' this should return 0 Years

INPUT : sô tiền gửi ban đầu principal , lãi suất interest , thuế tax , số tiền mong muốn desirePrincipal

Ngày đăng: 04/08/2022, 01:56

w