Peter’s solutions: More information

THE WEEKLY CHALLENGE

The Perl Camel
Current week »

Perl


Peter's solutions


Search code and blog

Week Date Task 1 Task 2
372 4 May 202604.05.26

Rearrange spaces [18]

Largest substring [11]

371 27 Apr 202627.04.26

Missing letter [13]

Subset equilibrium [33]

370 20 Apr 202620.04.26

Popular word [15]

Scramble string [32]

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 [7]

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 [15]

Subnet sheriff [31]

362 23 Feb 202623.02.26

Echo chamber [6]

Spellbound sorting [67]

361 16 Feb 202616.02.26

Zeckendorf representation [21]

Find celebrity [26]

360 9 Feb 202609.02.26

Text justifier [10]

Word sorter [9]

359 2 Feb 202602.02.26

Digital root [11]

String reduction [7]

358 26 Jan 202626.01.26

Max str value [9]

Encrypted string [14]

357 19 Jan 202619.01.26

Kaprekar constant [13]

Unique fraction generator [12]

356 12 Jan 202612.01.26

Kolakoski sequence [12]

Who wins [18]

355 5 Jan 202605.01.26

Thousand separator [6]

Mountain array [19]

354 29 Dec 202529.12.25

Min abs diff [13]

Shift grid [19]

353 22 Dec 202522.12.25

Max words [9]

Validate coupon [12]

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 [25]

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 [11]

Format phone number [12]

346 3 Nov 202503.11.25

Longest parenthesis [30]

Magic expression [19]

345 27 Oct 202527.10.25

Peak positions [9]

Last visitor [16]

344 20 Oct 202520.10.25

Array form compute [6]

Array formation [21]

343 13 Oct 202513.10.25

Zero friend [4]

Champion team [23]

342 6 Oct 202506.10.25

Balance string [17]

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 [8]

Odd matrix [17]

336 25 Aug 202525.08.25

Equal group [18]

Final score [19]

335 18 Aug 202518.08.25

Common characters [15]

Find winner [25]

334 11 Aug 202511.08.25

Range sum [6]

Nearest valid point [15]

333 4 Aug 202504.08.25

Straight line [28]

Duplicate zeros [4]

332 28 Jul 202528.07.25

Binary date [5]

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 [10]

329 7 Jul 202507.07.25

Counter integers [11]

Nice string [23]

328 30 Jun 202530.06.25

Replace all ? [10]

Good string [22]

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 [17]

322 19 May 202519.05.25

String format [10]

Rank array [10]

321 12 May 202512.05.25

Distinct average [8]

Backspace compare [9]

320 5 May 202505.05.25

Maximum count [6]

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 [7]

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 [9]

Alien dictionary [19]

304 13 Jan 202513.01.25

Arrange binary [13]

Maximum average [14]

303 6 Jan 202506.01.25

3-digits even [33]

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 * [21]

Hamming distance * [10]

300 16 Dec 202416.12.24

Beautiful arrangement [45]

Nested array [19]

299 9 Dec 202409.12.24

Replace words [7]

Word search [46]

298 2 Dec 202402.12.24

Maximal square [25]

Right interval [14]

297 25 Nov 202425.11.24

Contiguous array [16]

Semi-ordered permutation [17]

296 18 Nov 202418.11.24

String compression [35]

Matchstick square [26]

295 11 Nov 202411.11.24

Word break [14]

Jump game [29]

294 4 Nov 202404.11.24

Consecutive sequence [20]

Next permutation [17]

293 28 Oct 202428.10.24

Similar dominoes [16]

Boomerang [16]

292 21 Oct 202421.10.24

Twice largest [10]

Zuma game [61]

291 14 Oct 202414.10.24

Middle index [13]

Poker hand rankings [97]

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 [43]

287 16 Sep 202416.09.24

Strong password [36]

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 [39]

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 [11]

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 [17]

Bus route [24]

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 [6]

271 27 May 202427.05.24

Maximum ones [19]

Sort by 1 bits [14]

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 [6]

Number game [7]

267 29 Apr 202429.04.24

Product sign [15]

Line counts [25]

266 22 Apr 202422.04.24

Uncommon words [7]

X matrix [19]

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 [8]

Count equal divisible [17]

261 18 Mar 202418.03.24

Element digit sum [8]

Multiply by 2 [9]

260 11 Mar 202411.03.24

Unique occurrences [14]

Dictionary rank [15]

259 4 Mar 202404.03.24

Banking day offset [79]

Line parser [21]

258 26 Feb 202426.02.24

Count even digits number [5]

Sum of values [15]

257 19 Feb 202419.02.24

Smaller than current [9]

Reduced row echelon [56]

256 12 Feb 202412.02.24

Maximum pairs [15]

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 [26]

252 15 Jan 202415.01.24

Special numbers [10]

Unique sum zero [27]

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 [30]

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 [33]

245 27 Nov 202327.11.23

Sort language [8]

Largest of three [23]

244 20 Nov 202320.11.23

Count smaller [14]

Group hero [20]

243 13 Nov 202313.11.23

Reverse pairs [14]

Floor sum [18]

242 6 Nov 202306.11.23

Missing members [10]

Flip matrix [14]

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 [28]

Maximise greatness [46]

236 25 Sep 202325.09.23

Exact change [34]

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 [22]

233 4 Sep 202304.09.23

Similar words [15]

Frequency sort [16]

23228 Aug 2023 No challenge was set for this week
231 21 Aug 202321.08.23

Min max [3]

Senior citizens [3]

230 14 Aug 202314.08.23

Separate digits * [3]

Count words * [8]

229 7 Aug 202307.08.23

Lexicographically ordered [9]

Two out of three [10]

228 31 Jul 202331.07.23

Unique sum [5]

Empty array [19]

227 24 Jul 202324.07.23

Friday 13th [9]

Roman maths [32]

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 [15]

224 3 Jul 202303.07.23

Special notes [14]

Additive number [26]

223 26 Jun 202326.06.23

Count primes [22]

Box coins [33]

222 19 Jun 202319.06.23

Matching members [13]

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 [17]

Word stickers [55]

215 1 May 202301.05.23

Odd one out [7]

Number placement [11]

214 24 Apr 202324.04.23

Rank score [18]

Collect points [46]

213 17 Apr 202317.04.23

Fun sort [6]

Shortest route [67]

212 10 Apr 202310.04.23

Jumping letters [10]

Sequential substrings [27]

211 3 Apr 202303.04.23

Toeplitz matrix [31]

Split same average [33]

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 [38]

208 13 Mar 202313.03.23

Minimum index sum [20]

Duplicate and missing [18]

207 6 Mar 202306.03.23

Linear words [7]

The H-index for citations [7]

206 27 Feb 202327.02.23

Measuring the gaps [15]

Array pairings [5]

205 20 Feb 202320.02.23

Third highest value [20]

Maximum xor [23]

204 13 Feb 202313.02.23

Uphill or downhill? [21]

Reshape matrix [29]

203 6 Feb 202306.02.23

Special quads [43]

Copy folders [14]

202 30 Jan 202330.01.23

Three odd things [8]

Find the valleys [31]

201 23 Jan 202323.01.23

Missing numbers [13]

Piles of pennies [10]

200 16 Jan 202316.01.23

Arithmetic slices [28]

Seven segment 200 [32]

199 9 Jan 202309.01.23

Good pairs [16]

Good triplets [17]

198 2 Jan 202302.01.23

Max gap [24]

Prime count [12]

197 26 Dec 202226.12.22

Move zero * [12]

Wiggle sort * [23]

196 19 Dec 202219.12.22

Pattern 132 [17]

Range list [24]

195 12 Dec 202212.12.22

Special integers [12]

Most frequent even [18]

194 7 Dec 202207.12.22

Digital clock [18]

Frequency equalizer [40]

193 28 Nov 202228.11.22

Binary string [9]

Odd string [19]

192 21 Nov 202221.11.22

Binary flip [11]

Equal Distribution [3]

191 14 Nov 202214.11.22

Twice largest [15]

Cute List [15]

190 7 Nov 202207.11.22

Capital detection [8]

Decoded List [21]

189 31 Oct 202231.10.22

Greater character [17]

Array degree [7]

188 24 Oct 202224.10.22

Divisible Pairs [19]

Total Zero [19]

187 17 Oct 202217.10.22

Days together [22]

Magical triplets [46]

186 10 Oct 202210.10.22

Zip list [8]

Unicode makeover [12]

185 3 Oct 202203.10.22

Mac address [9]

Mask code [15]

184 26 Sep 202226.09.22

Sequence number [13]

Split array [21]

183 19 Sep 202219.09.22

Unique array [17]

Date difference [7]

182 12 Sep 202212.09.22

Max index [19]

Common path [15]

181 5 Sep 202205.09.22

Sentence order [24]

Hot day [21]

180 29 Aug 202229.08.22

First unique character * [10]

Trim list * [4]

179 22 Aug 202222.08.22

Ordinal number spelling * [44]

Unicode sparkline * [23]

178 15 Aug 202215.08.22

Quater-imaginary base [54]

Business date [7]

177 8 Aug 202208.08.22

Damm algorithm [22]

Palindromic prime cyclops [12]

176 1 Aug 202201.08.22

Permuted multiples [12]

Reversible numbers [10]

175 25 Jul 202225.07.22

Last Sunday [22]

Perfect totient numbers [11]

174 18 Jul 202218.07.22

Disarium numbers [22]

Permutation ranking [45]

173 11 Jul 202211.07.22

Esthetic number [18]

Sylvester’s sequence [17]

172 4 Jul 202204.07.22

Prime partition [31]

Five-number summary [9]

171 27 Jun 202227.06.22

Abundant number [15]

First-class function * [21]

170 20 Jun 202220.06.22

Primorial numbers [20]

Kronecker product [25]

169 13 Jun 202213.06.22

Brilliant numbers [16]

Achilles numbers [29]

168 6 Jun 202206.06.22

Perrin prime [18]

Home prime [6]

167 30 May 202230.05.22

Circular prime [12]

Gamma function [18]

166 23 May 202223.05.22

Hexadecimal words [40]

K-directory diff [32]

165 16 May 202216.05.22

Scalable vector graphics [28]

Line of best fit [51]

164 9 May 202209.05.22

Prime palindrome [14]

Happy numbers [33]

163 2 May 202202.05.22

Sum bitwise operator [20]

Summations [23]

162 25 Apr 202225.04.22

ISBN-13 [13]

Wheatstone-Playfair [17]

161 18 Apr 202218.04.22

Abecedarian words [26]

Pangrams [18]

160 11 Apr 202211.04.22

Four is magic [18]

Equilibrium index [7]

159 4 Apr 202204.04.22

Farey sequence * [14]

Möbius number * [9]

158 28 Mar 202228.03.22

Additive primes [10]

First series Cuban primes [13]

157 21 Mar 202221.03.22

Pythagorean means [19]

Brazilian number [10]

156 14 Mar 202214.03.22

Pernicious numbers [15]

Weird number [28]

155 7 Mar 202207.03.22

Fortunate numbers [10]

Pisano period [14]

154 28 Feb 202228.02.22

Missing permutation [12]

Padovan primes [14]

153 21 Feb 202221.02.22

Left factorials [10]

Factorions [21]

152 14 Feb 202214.02.22

Triangle sum path [5]

Rectangle area [5]

151 7 Feb 202207.02.22

Binary tree depth [27]

Rob the house [7]

150 31 Jan 202231.01.22

Fibonacci words [20]

Square-free integer [23]

149 24 Jan 202224.01.22

Fibonacci digit sum [8]

Largest square [17]

148 17 Jan 202217.01.22

Eban numbers [27]

Cardano triplets [6]

147 10 Jan 202210.01.22

Truncatable prime [31]

Pentagon numbers [21]

146 3 Jan 202203.01.22

10001st prime number [23]

Curious fraction tree [17]

145 27 Dec 202127.12.21

Dot product [21]

Palindromic tree [5]

144 20 Dec 202120.12.21

Semiprime [12]

Ulam sequence [27]

143 13 Dec 202113.12.21

Calculator [7]

Stealthy number [20]

142 6 Dec 202106.12.21

Divisor last digit [25]

Sleep sort [14]

141 29 Nov 202129.11.21

Number divisors [25]

Like numbers [28]

140 22 Nov 202122.11.21

Add binary [10]

Multiplication table [17]

139 15 Nov 202115.11.21

JortSort [16]

Long primes [35]

138 8 Nov 202108.11.21

Workdays [8]

Split number [34]

137 1 Nov 202101.11.21

Long year * [6]

Lychrel number * [19]

136 25 Oct 202125.10.21

Two friendly * [13]

Fibonacci sequence * [25]

135 18 Oct 202118.10.21

Middle 3-digits [14]

Validate SEDOL [17]

134 11 Oct 202111.10.21

Pandigital numbers [13]

Distinct terms count [13]

133 4 Oct 202104.10.21

Integer square root [16]

Smith numbers [30]

132 27 Sep 202127.09.21

Mirror dates * [10]

Hash join * [32]

131 20 Sep 202120.09.21

Consecutive arrays [8]

Find pairs [13]

130 13 Sep 202113.09.21

Odd number [9]

Binary search tree [41]

129 6 Sep 202106.09.21

Root distance * [16]

Add linked lists [20]

128 30 Aug 202130.08.21

Maximum sub-matrix * [37]

Minimum platforms [15]

127 23 Aug 202123.08.21

Disjoint sets * [12]

Conflict intervals * [15]

126 16 Aug 202116.08.21

Count numbers * [6]

Minesweeper game * [27]

125 9 Aug 202109.08.21

Pythagorean triples [14]

Binary tree diameter * [37]

124 2 Aug 202102.08.21

Happy women’s day * [7]

Tug of war [26]

123 26 Jul 202126.07.21

Ugly numbers * [20]

Square points * [16]

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 * [27]

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 * [64]

117 14 Jun 202114.06.21

Missing row * [24]

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 * [58]

112 10 May 202110.05.21

Canonical path * [13]

Climb stairs * [19]

111 3 May 202103.05.21

Search matrix * [28]

Ordered letters * [35]

110 26 Apr 202126.04.21

Valid phone numbers * [15]

Transpose file * [18]

109 19 Apr 202119.04.21

Chowla numbers * [9]

Four squares puzzle * [18]

108 12 Apr 202112.04.21

Locate memory * [9]

Bell numbers * [12]

107 5 Apr 202105.04.21

Self-descriptive numbers * [17]

List methods * [6]

106 29 Mar 202129.03.21

Maximum gap * [11]

Decimal string * [50]

105 22 Mar 202122.03.21

Nth root * [3]

The name game * [17]

104 15 Mar 202115.03.21

Fusc sequence * [13]

Nim game * [88]

103 8 Mar 202108.03.21

Chinese zodiac * [9]

What’s playing? * [38]

102 1 Mar 202101.03.21

Rare numbers * [10]

Hash-counting string * [10]

101 22 Feb 202122.02.21

Pack a spiral * [44]

Origin-containing triangle * [10]

*  completed after the deadline and not submitted
[nn]  lines of code
542  total tasks completed
9500  total lines of code
291/2  task with most lines (97)

 

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