Constant-time string equality

Write codeEasy12 minStripe and Coinbase style

Your task

Implement a constant-time string equality check used to compare secrets (tokens, MACs) without leaking timing. Given two strings a and b, return True if they are equal. Your comparison must not short-circuit on the first differing character; if the lengths differ you may return False immediately (length is not secret here). Do not use Python's built-in ==, hmac, or secrets comparison helpers.

Examples

constant_time_equal(a: str, b: str) -> bool
Example 1
Inputconstant_time_equal("abc", "abc")
OutputTrue