HPI 2026 Editorial

Revision en9, by shsh, 2026-03-08 02:26:21

Thank you to everyone who attended this year's Harker Programming Invitational (HPI)! Novice and Advanced problems have been uploaded to the Gym for upsolving.

Harker

Pretty straightforward: most languages have a standard library function for finding a given substring in a string, so you can just use that.

Example code (Team Aarav)

String Runs

Observe that when concatening strings $$$a$$$ and $$$b$$$, $$$|f(a + b)| = |f(a)| + |f(b)|$$$ unless the last character of $$$a$$$ equals the first character of $$$b$$$, in which case $$$|f(a + b)| = |f(a)| + |f(b)| - 1$$$. Therefore, for each string $$$w_i$$$, we only need to maintain three values: its first character, last character, and $$$|f(w_i)|$$$.

Example code (eevee0)

Reverse Suffix

Hint 1
Hint 2
Solution
Example code (Team Aarav)

Regina's Task

Hint
Solution
Example code (shsh)

Tung Tung String

Hint
Solution

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en18 English shsh 2026-03-09 06:56:58 24
en17 English shsh 2026-03-09 01:39:38 4
en16 English shsh 2026-03-09 01:37:40 89 Tiny change: 'otation:\n- Let $|' -> 'otation:\n\n- Let $|'
en15 English shsh 2026-03-09 01:26:51 24 Tiny change: '# HPI 2026 Editorial\n\nThank you ' -> 'Thank you '
en14 English shsh 2026-03-09 01:23:31 185
en13 English shsh 2026-03-09 01:21:07 0 (published)
en12 English shsh 2026-03-09 01:19:51 16
en11 English shsh 2026-03-09 01:17:59 24220
en10 English shsh 2026-03-08 02:29:59 358
en9 English shsh 2026-03-08 02:26:21 893 Tiny change: 'rt it.\n\nFor a ' -> 'rt it.\n\n---\n\nFor a '
en8 English shsh 2026-03-08 01:29:14 3 Tiny change: 'ases:\n\n1, Making th' -> 'ases:\n\n1. Making th'
en7 English shsh 2026-03-08 01:28:51 271
en6 English shsh 2026-03-08 01:25:45 678
en5 English shsh 2026-03-08 01:15:06 631 Tiny change: 'd in $\cal(O)(n + m)$.\' -> 'd in $\cal{O}(n + m)$.\'
en4 English shsh 2026-03-08 01:04:09 646
en3 English shsh 2026-03-08 00:59:54 1835 Tiny change: 'er:eevee0])">\n```py' -> 'er:eevee0] )">\n```py'
en2 English shsh 2026-03-08 00:49:03 1386
en1 English shsh 2026-03-08 00:31:48 666 Initial revision (saved to drafts)