Your team is transitioning a codebase where a colleague has been writing identifiers in snake case (e.g., "my_counter"), but your company’s coding standard requires lower camel case (e.g., "myCounter").
You are given a source string src. Return a new string in which every snake case segment found anywhere in src is converted to lower camel case. Do not limit your search to variable-like tokens—apply the transformation to any matching substring that follows the rules below.
"__the_variable" shall become "__theVariable"."the_variable__" shall become "theVariable__".Constraints:
0 ≤ src.length ≤ 10⁵Example 1:
src = "This is the doc_string for __secret_fun"
"This is the docString for __secretFun"
The string contains two snake case segments. "doc_string" becomes "docString" by removing the underscore and capitalizing the next letter. "__secret_fun" has two leading underscores that are kept; the body "secret_fun" is transformed to "secretFun", giving "__secretFun".
Example 2:
src = "int my_counter = get_user_id(__secret_value__);"
"int myCounter = getUserId(__secretValue__);"
Example 3:
src = "// parse_http_response and store in __cache_key__ after retry_count"
"// parseHttpResponse and store in __cacheKey__ after retryCount"
Example 1
Input: total_match_count
Output: totalMatchCount
Example 2
Input: __private_aux_field__
Output: __privateAuxField__