Hackerrank – CamelCase

Hackerrank – Problem Statement

A description of the problem can be found on Hackerrank.

Solution

There are 2 options

  1. To split the string by regular expression"[A-Z]" and then print the length of an array returned from splitting.
  2. To iterate over all characters, count the uppercase and print their count + 1

I created solution in:

All solutions are also available on my GitHub.

Java

Javascript

Scala

Ruby

Leave a Reply

Your email address will not be published. Required fields are marked *