Peter’s blog

THE WEEKLY CHALLENGE
More information

The Perl Camel

Perl


Peter's solutions

Search code and blog for:

Week Date Task 1 Task 2
396 19 Oct 202619.10.26

Finishing order 8

Trionic array 11

395 12 Oct 202612.10.26

Complex number 7

Word squares 14

394 5 Oct 202605.10.26

Alternate case 36

Alternating vowels consonants 22

393 28 Sep 202628.09.26

Pythagoras multiplied 21

Prime step 15

392 21 Sep 202621.09.26

Convert palindrome 9

Words length product 19

391 14 Sep 202614.09.26

Array median 11

Arrange box 24

390 7 Sep 202607.09.26

Decode string 18

Order characters 21

389 31 Aug 202631.08.26

Reorder notes 14

Zigzag subarray 13

388 24 Aug 202624.08.26

Dyck words 15

Secret santa 15

387 17 Aug 202617.08.26

Rearrange binary string 7

Atoms count 27

386 10 Aug 202610.08.26

Reverse base 17

Rational numbers 38

385 3 Aug 202603.08.26

Uncommon words 10

Outermost parentheses 20

384 27 Jul 202627.07.26

Base n 14

Special binary substrings 11

383 20 Jul 202620.07.26

Similar list 17

Nearest RGB 11

382 13 Jul 202613.07.26

Hamiltonian cycle 33

Replace question mark 12

381 6 Jul 202606.07.26

Same row column 24

Smaller greater element 7

380 29 Jun 202629.06.26

Sum of frequencies 15

Reverse degree 9

379 22 Jun 202622.06.26

Reverse string 8

Armstrong number 11

378 15 Jun 202615.06.26

Second largest digit 10

Sum of words 11

377 8 Jun 202608.06.26

Reverse existence 11

Prefix suffix 12

376 1 Jun 202601.06.26

Chessboard squares 7

Doubled words 33

375 25 May 202625.05.26

Single common word 11

Find K-Beauty 10

374 18 May 202618.05.26

Count vowel 20

Largest same-digits number 8

373 11 May 202611.05.26

Equal list 7

List division 19

372 4 May 202604.05.26

Rearrange spaces 18

Largest substring 11

371 27 Apr 202627.04.26

Missing letter 13

Subset equilibrium 29

370 20 Apr 202620.04.26

Popular word 15

Scramble string 31

369 13 Apr 202613.04.26

Valid tag 11

Group division 7

368 6 Apr 202606.04.26

Make it bigger 8

Big and little omega 29

367 30 Mar 202630.03.26

Max odd binary 15

Conflict events 19

366 23 Mar 202623.03.26

Count prefixes 6

Valid times 20

365 16 Mar 202616.03.26

Alphabet index digit sum 13

Valid token counter 19

364 9 Mar 202609.03.26

Decrypt string 8

Goal parser 8

363 2 Mar 202602.03.26

String lie detector 14

Subnet sheriff 30

362 23 Feb 202623.02.26

Echo chamber 6

Spellbound sorting 66

361 16 Feb 202616.02.26

Zeckendorf representation 18

Find celebrity 26

360 9 Feb 202609.02.26

Text justifier 10

Word sorter 9

359 2 Feb 202602.02.26

Digital root 10

String reduction 7

358 26 Jan 202626.01.26

Max str value 9

Encrypted string 13

357 19 Jan 202619.01.26

Kaprekar constant 13

Unique fraction generator 12

356 12 Jan 202612.01.26

Kolakoski sequence 11

Who wins 16

355 5 Jan 202605.01.26

Thousand separator 6

Mountain array 19

354 29 Dec 202529.12.25

Min abs diff 13

Shift grid 17

353 22 Dec 202522.12.25

Max words 9

Validate coupon 7

352 15 Dec 202515.12.25

Match string 15

Binary prefix 10

351 8 Dec 202508.12.25

Special average 9

Arithmetic progression 13

350 1 Dec 202501.12.25

Good substrings 13

Shuffle pairs 22

349 24 Nov 202524.11.25

Power string 8

Meeting point 10

348 17 Nov 202517.11.25

String alike 16

Convert time 17

347 10 Nov 202510.11.25

Format date 10

Format phone number 10

346 3 Nov 202503.11.25

Longest parenthesis 29

Magic expression 19

345 27 Oct 202527.10.25

Peak positions 8

Last visitor 16

344 20 Oct 202520.10.25

Array form compute 3

Array formation 21

343 13 Oct 202513.10.25

Zero friend 4

Champion team 23

342 6 Oct 202506.10.25

Balance string 15

Max score 13

341 29 Sep 202529.09.25

Broken keyboard 9

Reverse prefix 9

340 22 Sep 202522.09.25

Duplicate removals 19

Ascending numbers 12

339 15 Sep 202515.09.25

Max diff 25

Peak point 9

338 8 Sep 202508.09.25

Highest row 18

Max distance 8

337 1 Sep 202501.09.25

Smaller than current 7

Odd matrix 16

336 25 Aug 202525.08.25

Equal group 18

Final score 19

335 18 Aug 202518.08.25

Common characters 15

Find winner 21

334 11 Aug 202511.08.25

Range sum 6

Nearest valid point 12

333 4 Aug 202504.08.25

Straight line 27

Duplicate zeros 4

332 28 Jul 202528.07.25

Binary date 3

Odd letters 9

331 21 Jul 202521.07.25

Last word 4

Buddy strings 28

330 14 Jul 202514.07.25

Clear digits 6

Title capital 7

329 7 Jul 202507.07.25

Counter integers 11

Nice string 23

328 30 Jun 202530.06.25

Replace all ? 10

Good string 21

327 23 Jun 202523.06.25

Missing integers 7

Mad 9

326 16 Jun 202516.06.25

Day of the year 11

Decompressed list 7

325 9 Jun 202509.06.25

Consecutive ones 13

Final price 10

324 2 Jun 202502.06.25

2d array 20

Total xor 11

323 26 May 202526.05.25

Increment decrement 7

Tax amount 16

322 19 May 202519.05.25

String format 10

Rank array 10

321 12 May 202512.05.25

Distinct average 8

Backspace compare 8

320 5 May 202505.05.25

Maximum count 5

Sum difference 7

319 28 Apr 202528.04.25

Word count 8

Minimum common 13

318 21 Apr 202521.04.25

Group position 6

Reverse equals 20

317 14 Apr 202514.04.25

Acronyms 7

Friendly strings 18

316 7 Apr 202507.04.25

Circular 9

Subsequence 18

315 1 Apr 202501.04.25

Find words 7

Find third 7

314 24 Mar 202524.03.25

Equal strings 14

Sort column 11

313 17 Mar 202517.03.25

Broken keys 6

Reverse letters 10

312 10 Mar 202510.03.25

Minimum time 12

Balls and boxes 8

311 3 Mar 202503.03.25

Upper lower 6

Group digit sum 14

310 24 Feb 202524.02.25

Arrays intersection 16

Sort odd even 13

309 17 Feb 202517.02.25

Min gap 11

Min diff 11

308 10 Feb 202510.02.25

Count common 11

Decode xor 11

307 3 Feb 202503.02.25

Check order 9

Find anagrams 16

306 27 Jan 202527.01.25

Odd sum 9

Last element 13

305 20 Jan 202520.01.25

Binary prefix 8

Alien dictionary 19

304 13 Jan 202513.01.25

Arrange binary 13

Maximum average 14

303 6 Jan 202506.01.25

3-digits even 32

Delete and earn 27

302 30 Dec 202430.12.24

Ones and zeroes 16

Step by step 9

301 23 Dec 202423.12.24

Largest number * 19

Hamming distance * 10

300 16 Dec 202416.12.24

Beautiful arrangement 42

Nested array 19

299 9 Dec 202409.12.24

Replace words 7

Word search 46

298 2 Dec 202402.12.24

Maximal square 24

Right interval 14

297 25 Nov 202425.11.24

Contiguous array 16

Semi-ordered permutation 17

296 18 Nov 202418.11.24

String compression 34

Matchstick square 26

295 11 Nov 202411.11.24

Word break 20

Jump game 28

294 4 Nov 202404.11.24

Consecutive sequence 18

Next permutation 16

293 28 Oct 202428.10.24

Similar dominoes 16

Boomerang 16

292 21 Oct 202421.10.24

Twice largest 10

Zuma game 59

291 14 Oct 202414.10.24

Middle index 13

Poker hand rankings 90

290 7 Oct 202407.10.24

Double exist 8

Luhn’s algorithm 17

289 30 Sep 202430.09.24

Third maximum 16

Jumbled letters 30

288 23 Sep 202423.09.24

Closest palindrome 11

Contiguous block 39

287 16 Sep 202416.09.24

Strong password 35

Valid number 9

286 9 Sep 202409.09.24

Self spammer 6

Order game 20

285 2 Sep 202402.09.24

No connection 17

Making change 28

284 26 Aug 202426.08.24

Lucky integer 11

Relative sort 16

283 19 Aug 202419.08.24

Unique number 10

Digit count value 12

282 12 Aug 202412.08.24

Good integer 9

Changing keys 9

281 5 Aug 202405.08.24

Check color 4

Knight’s move 38

280 29 Jul 202429.07.24

Twice appearance 9

Count asterisks 7

279 22 Jul 202422.07.24

Sort letters 7

Split string 6

278 15 Jul 202415.07.24

Sort string 6

Reverse word 9

277 8 Jul 202408.07.24

Count common 10

Strong pair 44

276 1 Jul 202401.07.24

Complete day 13

Maximum frequency 13

275 24 Jun 202424.06.24

Broken keys 8

Replace digits 12

274 17 Jun 202417.06.24

Goat Latin 16

Bus route 22

273 10 Jun 202410.06.24

Percentage of character 7

B after A 4

272 3 Jun 202403.06.24

Defang IP address 3

String score 4

271 27 May 202427.05.24

Maximum ones 18

Sort by 1 bits 12

270 20 May 202420.05.24

Special positions 22

Equalize array 20

269 13 May 202413.05.24

Bitwise or 4

Distribute elements 11

268 6 May 202406.05.24

Magic numbers 3

Number game 7

267 29 Apr 202429.04.24

Product sign 15

Line counts 24

266 22 Apr 202422.04.24

Uncommon words 7

X matrix 18

265 15 Apr 202415.04.24

33% appearance 12

Completing word 20

264 8 Apr 202408.04.24

Greatest English letter 11

Target array 19

263 1 Apr 202401.04.24

Target index 12

Merge items 10

262 25 Mar 202425.03.24

Max positive negative 7

Count equal divisible 16

261 18 Mar 202418.03.24

Element digit sum 7

Multiply by 2 8

260 11 Mar 202411.03.24

Unique occurrences 14

Dictionary rank 15

259 4 Mar 202404.03.24

Banking day offset 77

Line parser 21

258 26 Feb 202426.02.24

Count even digits number 5

Sum of values 14

257 19 Feb 202419.02.24

Smaller than current 9

Reduced row echelon 55

256 12 Feb 202412.02.24

Maximum pairs 13

Merge strings 12

255 5 Feb 202405.02.24

Odd character 5

Most frequent word 19

254 29 Jan 202429.01.24

Three power 24

Reverse vowels 19

253 22 Jan 202422.01.24

Split strings 12

Weakest row 25

252 15 Jan 202415.01.24

Special numbers 10

Unique sum zero 26

251 8 Jan 202408.01.24

Concatenation Value 10

Lucky numbers 45

250 1 Jan 202401.01.24

Smallest index 10

Alphanumeric string value 8

249 25 Dec 202325.12.23

Equal pairs 11

DI string match 33

248 18 Dec 202318.12.23

Shortest distance 17

Submatrix sum 22

247 11 Dec 202311.12.23

Secret Santa 23

Most frequent letter pair 12

246 4 Dec 202304.12.23

6 out of 49 11

Sort language 31

245 27 Nov 202327.11.23

Sort language 8

Largest of three 22

244 20 Nov 202320.11.23

Count smaller 14

Group hero 18

243 13 Nov 202313.11.23

Reverse pairs 14

Floor sum 18

242 6 Nov 202306.11.23

Missing members 10

Flip matrix 13

241 30 Oct 202330.10.23

Arithmetic triplets 21

Prime order 48

240 23 Oct 202323.10.23

Acronym 9

Build array 13

239 16 Oct 202316.10.23

Same string 4

Consistent strings 10

238 9 Oct 202309.10.23

Running sum 7

Persistence sort 25

237 9 Oct 202309.10.23

Seize the day 27

Maximise greatness 45

236 25 Sep 202325.09.23

Exact change 33

Array loops 18

235 18 Sep 202318.09.23

Remove one 29

Duplicate zeroes 7

234 11 Sep 202311.09.23

Common characters 19

Unequal triplets 21

233 4 Sep 202304.09.23

Similar words 15

Frequency sort 16

232 28 Aug 202328.08.23 No challenge was set for week 232
231 21 Aug 202321.08.23

Min max 3

Senior citizens 3

230 14 Aug 202314.08.23

Separate digits * 3

Count words * 7

229 7 Aug 202307.08.23

Lexicographically ordered 7

Two out of three 8

228 31 Jul 202331.07.23

Unique sum 5

Empty array 19

227 24 Jul 202324.07.23

Friday 13th 9

Roman maths 30

226 17 Jul 202317.07.23

Shuffle strings 8

Zero array 17

225 10 Jul 202310.07.23

Max words 10

Left right sum diff 12

224 3 Jul 202303.07.23

Special notes 14

Additive number 26

223 26 Jun 202326.06.23

Count primes 22

Box coins 32

222 19 Jun 202319.06.23

Matching members 12

Last member 13

221 12 Jun 202312.06.23

Good strings 17

Arithmetic subsequences 34

220 5 Jun 202305.06.23

Common characters 8

Squareful 26

219 29 May 202329.05.23

Sorted squares 3

Travel expenditure 30

218 22 May 202322.05.23

Maximum product 28

Matrix sum 34

217 15 May 202315.05.23

Sorted matrix 7

Max number 18

216 8 May 202308.05.23

Registration number 16

Word stickers 52

215 1 May 202301.05.23

Odd one out 7

Number placement 9

214 24 Apr 202324.04.23

Rank score 17

Collect points 44

213 17 Apr 202317.04.23

Fun sort 4

Shortest route 65

212 10 Apr 202310.04.23

Jumping letters 10

Sequential substrings 27

211 3 Apr 202303.04.23

Toeplitz matrix 31

Split same average 32

210 27 Mar 202327.03.23

Kill and win 32

Number collision 18

209 20 Mar 202320.03.23

A 3-letter alphabet 10

Merging emails 37

208 13 Mar 202313.03.23

Minimum index sum 20

Duplicate and missing 17

207 6 Mar 202306.03.23

Linear words 7

The H-index for citations 6

206 27 Feb 202327.02.23

Measuring the gaps 15

Array pairings 4

205 20 Feb 202320.02.23

Third highest value 20

Maximum xor 22

204 13 Feb 202313.02.23

Uphill or downhill? 16

Reshape matrix 34

203 6 Feb 202306.02.23

Special quads 39

Copy folders 28

202 30 Jan 202330.01.23

Three odd things 5

Find the valleys 27

201 23 Jan 202323.01.23

Missing numbers 10

Piles of pennies 18

200 16 Jan 202316.01.23

Arithmetic slices 32

Seven segment 200 28

199 9 Jan 202309.01.23

Good pairs 13

Good triplets 19

198 2 Jan 202302.01.23

Max gap 21

Prime count 20

197 26 Dec 202226.12.22

Move zero * 16

Wiggle sort * 30

196 19 Dec 202219.12.22

Pattern 132 14

Range list 21

195 12 Dec 202212.12.22

Special integers 35

Most frequent even 14

194 7 Dec 202207.12.22

Digital clock 15

Frequency equalizer 37

193 28 Nov 202228.11.22

Binary string 6

Odd string 15

192 21 Nov 202221.11.22

Binary flip 8

Equal Distribution 25

191 14 Nov 202214.11.22

Twice largest 11

Cute List 23

190 7 Nov 202207.11.22

Capital detection 5

Decoded List 33

189 31 Oct 202231.10.22

Greater character 13

Array degree 23

188 24 Oct 202224.10.22

Divisible Pairs 15

Total Zero 16

187 17 Oct 202217.10.22

Days together 24

Magical triplets 40

186 10 Oct 202210.10.22

Zip list 11

Unicode makeover 17

185 3 Oct 202203.10.22

Mac address 4

Mask code 11

184 26 Sep 202226.09.22

Sequence number 9

Split array 18

183 19 Sep 202219.09.22

Unique array 31

Date difference 26

182 12 Sep 202212.09.22

Max index 13

Common path 19

181 5 Sep 202205.09.22

Sentence order 17

Hot day 7

180 29 Aug 202229.08.22

First unique character * 13

Trim list * 6

179 22 Aug 202222.08.22

Ordinal number spelling * 47

Unicode sparkline * 25

178 15 Aug 202215.08.22

Quater-imaginary base 60

Business date 38

177 8 Aug 202208.08.22

Damm algorithm 9

Palindromic prime cyclops 8

176 1 Aug 202201.08.22

Permuted multiples 13

Reversible numbers 7

175 25 Jul 202225.07.22

Last Sunday 18

Perfect totient numbers 30

174 18 Jul 202218.07.22

Disarium numbers 17

Permutation ranking 60

173 11 Jul 202211.07.22

Esthetic number 13

Sylvester’s sequence 8

172 4 Jul 202204.07.22

Prime partition 46

Five-number summary 30

171 27 Jun 202227.06.22

Abundant number 10

First-class function * 21

170 20 Jun 202220.06.22

Primorial numbers 16

Kronecker product 47

169 13 Jun 202213.06.22

Brilliant numbers 11

Achilles numbers 24

168 6 Jun 202206.06.22

Perrin prime 12

Home prime 10

167 30 May 202230.05.22

Circular prime 27

Gamma function 23

166 23 May 202223.05.22

Hexadecimal words 36

K-directory diff 26

165 16 May 202216.05.22

Scalable vector graphics 17

Line of best fit 35

164 9 May 202209.05.22

Prime palindrome 10

Happy numbers 28

163 2 May 202202.05.22

Sum bitwise operator 15

Summations 19

162 25 Apr 202225.04.22

ISBN-13 9

Wheatstone-Playfair 71

161 18 Apr 202218.04.22

Abecedarian words 21

Pangrams 42

160 11 Apr 202211.04.22

Four is magic 12

Equilibrium index 22

159 4 Apr 202204.04.22

Farey sequence * 17

Möbius number * 15

158 28 Mar 202228.03.22

Additive primes 5

First series Cuban primes 8

157 21 Mar 202221.03.22

Pythagorean means 12

Brazilian number 22

156 14 Mar 202214.03.22

Pernicious numbers 10

Weird number 27

155 7 Mar 202207.03.22

Fortunate numbers 25

Pisano period 27

154 28 Feb 202228.02.22

Missing permutation 6

Padovan primes 9

153 21 Feb 202221.02.22

Left factorials 7

Factorions 18

152 14 Feb 202214.02.22

Triangle sum path 17

Rectangle area 28

151 7 Feb 202207.02.22

Binary tree depth 22

Rob the house 16

150 31 Jan 202231.01.22

Fibonacci words 15

Square-free integer 19

149 24 Jan 202224.01.22

Fibonacci digit sum 15

Largest square 31

148 17 Jan 202217.01.22

Eban numbers 35

Cardano triplets 22

147 10 Jan 202210.01.22

Truncatable prime 27

Pentagon numbers 22

146 3 Jan 202203.01.22

10001st prime number 18

Curious fraction tree 26

145 27 Dec 202127.12.21

Dot product 18

Palindromic tree 21

144 20 Dec 202120.12.21

Semiprime 24

Ulam sequence 24

143 13 Dec 202113.12.21

Calculator 4

Stealthy number 15

142 6 Dec 202106.12.21

Divisor last digit 22

Sleep sort 10

141 29 Nov 202129.11.21

Number divisors 21

Like numbers 23

140 22 Nov 202122.11.21

Add binary 17

Multiplication table 14

139 15 Nov 202115.11.21

JortSort 11

Long primes 49

138 8 Nov 202108.11.21

Workdays 15

Split number 30

137 1 Nov 202101.11.21

Long year * 7

Lychrel number * 23

136 25 Oct 202125.10.21

Two friendly * 18

Fibonacci sequence * 30

135 18 Oct 202118.10.21

Middle 3-digits 15

Validate SEDOL 27

134 11 Oct 202111.10.21

Pandigital numbers 10

Distinct terms count 37

133 4 Oct 202104.10.21

Integer square root 18

Smith numbers 43

132 27 Sep 202127.09.21

Mirror dates * 13

Hash join * 33

131 20 Sep 202120.09.21

Consecutive arrays 12

Find pairs 15

130 13 Sep 202113.09.21

Odd number 10

Binary search tree 27

129 6 Sep 202106.09.21

Root distance * 18

Add linked lists 19

128 30 Aug 202130.08.21

Maximum sub-matrix * 46

Minimum platforms 15

127 23 Aug 202123.08.21

Disjoint sets * 17

Conflict intervals * 22

126 16 Aug 202116.08.21

Count numbers * 6

Minesweeper game * 26

125 9 Aug 202109.08.21

Pythagorean triples 14

Binary tree diameter * 36

124 2 Aug 202102.08.21

Happy International Women’s Day * 1

Tug of war 25

123 26 Jul 202126.07.21

Ugly numbers * 20

Square points * 10

122 19 Jul 202119.07.21

Average of stream * 9

Basketball points * 17

121 12 Jul 202112.07.21

Invert bit * 8

The travelling salesman * 26

120 5 Jul 202105.07.21

Swap odd/even bits * 11

Clock angle * 9

119 28 Jun 202128.06.21

Swap nibbles * 12

Sequence without 1-on-1 * 20

118 21 Jun 202121.06.21

Binary palindrome * 8

Adventure of knight * 61

117 14 Jun 202114.06.21

Missing row * 9

Find possible paths * 18

116 7 Jun 202107.06.21

Number sequence * 17

Sum of squares * 10

115 31 May 202131.05.21

String chain * 27

Largest multiple * 8

114 24 May 202124.05.21

Next palindrome number * 30

Higher integer set bits * 14

113 17 May 202117.05.21

Represent integer * 20

Recreate binary tree * 53

112 10 May 202110.05.21

Canonical path * 13

Climb stairs * 19

111 3 May 202103.05.21

Search matrix * 28

Ordered letters * 33

110 26 Apr 202126.04.21

Valid phone numbers * 7

Transpose file * 12

109 19 Apr 202119.04.21

Chowla numbers * 9

Four squares puzzle * 16

108 12 Apr 202112.04.21

Locate memory * 6

Bell numbers * 11

107 5 Apr 202105.04.21

Self-descriptive numbers * 17

List methods * 6

106 29 Mar 202129.03.21

Maximum gap * 11

Decimal string * 48

105 22 Mar 202122.03.21

Nth root * 3

The name game * 11

104 15 Mar 202115.03.21

Fusc sequence * 11

Nim game * 60

103 8 Mar 202108.03.21

Chinese zodiac * 8

What’s playing? * 27

102 1 Mar 202101.03.21

Rare numbers * 10

Hash-counting string * 10

101 22 Feb 202122.02.21

Pack a spiral * 33

Origin-containing triangle * 8

*  completed after the deadline and not submitted
nn  lines of code
590  total tasks completed
10322  total lines of code
291/2  task with most lines (90)

 

Any content of this website which has been created by Peter Campbell Smith is in the public domain