Hackerrank solution Camelcase of Strings in Java simple 1 line code | Algorithm
HackerRank Online Judge Solution | Algorithm
HackerRank Main Problem Link - https://www.hackerrank.com/challenges/camelcase
Problem Name: HackerRank Problem
Problem Number : HackerRank Problem Camelcase Solution
Online Judge : HackerRank Online Judge Solution
Category: Algorithm
Solution Language : java
HackerRank Solution Camelcase Code in Java:
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); String s = input.next(); int totalWord = s.length() - s.replaceAll("[A-Z]", "").length() + 1; System.out.println(totalWord); } }
No comments:
Post a Comment