โ† HSBC questions

Longest even length substring with equal left and right sum

Filed under HSBC

Given a string of digits, find the maximum length of a substring (of even length 2k) such that the sum of the first k digits equals the sum of the last k digits.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related HSBC questions

Collected from public candidate posts and coding forums. Updated Nov 2026.