Convert Snake Case to Camel Case
Updated
Problem statement
Convert a lowercase snake-case string to lower camel case. Keep the first nonempty component lowercase, capitalize the first letter of each later nonempty component, and remove every underscore. Consecutive, leading, and trailing underscores are allowed.
Function
snakeToCamelCase(snake: String) → StringExamples
Example 1
snake = "hello_world"return = "helloWorld"The later component begins with an uppercase letter.
Example 2
snake = "one_two_three"return = "oneTwoThree"Every later component is capitalized.
Constraints
0 <= snake.length <= 100000snakecontains lowercase English letters and underscores.
More ZipRecruiter Online Assessment questions
- Four-Level Banking System with Scheduled PaymentsOA · Seen Oct 2026
- Count Three-Digit Numbers with Distinct DigitsOA · Seen Oct 2024
- Longest Frequency-Bounded SubarrayOA · Seen Oct 2024
- Minimum Changes to Draw a YOA · Seen Oct 2024
- Apply Binary State OperationsOA · Seen Sep 2024
- Simulate Orchard Rot SpreadOA · Seen Sep 2024
- Compare Odd- and Even-Index SumsOA · Seen Sep 2024
- Coordinate Removals with Column GravityOA · Seen Sep 2024
- Lexicographically Smallest End ReversalOA · Seen Sep 2024
- Recursively Expanded Shell Command CountsOA · Seen Sep 2024
Similar questions at other companies
- Fill One Exact-Length Binary WindowAmazon · OA
- Remove Vowels from a StringHSBC · OAHSBC interview questions
- Branch with the Most FilesCapital One · OACapital One interview questions
- Count User Mentions in Chat MessagesRamp · OARamp interview questions
- Maximum Ones After K OperationsGoldman Sachs · OAGoldman Sachs interview questions
- Total Each Letter's Count in an Encoded StringIBM · OAIBM interview questions
- Robot Stops Left or Right (Forward Deployed Engineer)Boston Consulting Group · OABoston Consulting Group interview questions
- Find Words That Can Be Formed by CharactersTabaPay · OA
- Blood Type Inheritance: Possible Parent GenotypesAbridge · OAAbridge interview questions
- Count Palindrome Addition ChoicesThe D.E. Shaw Group · OAThe D.E. Shaw Group interview questions