6 kyu

Simple Fun #305: Typist

743 of 1,613myjinxin2015

Description:

Task

John is a typist. He has a habit of typing: he never use the Shift key to switch case, just using only Caps Lock.

Given a string s. Your task is to count how many times the keyboard has been tapped by John.

You can assume that, at the beginning the Caps Lock light is not lit.

Input/Output

[input] string s

A non-empty string. It contains only English letters(uppercase or lowercase).

1 ≤ s.length ≤ 10000

[output] an integer

The number of times John tapped the keyboard.

Example

For s = "a", the output should be 1.

John hit button a.

For s = "aa", the output should be 2.

John hit button a, a.

For s = "A", the output should be 2.

John hit button Caps Lock, A.

For s = "Aa", the output should be 4.

John hit button Caps Lock, A, Caps Lock, a.

Fundamentals

Stats:

CreatedMay 25, 2017
PublishedMay 25, 2017
Warriors Trained2562
Total Skips35
Total Code Submissions3959
Total Times Completed1613
JavaScript Completions743
Python Completions773
Groovy Completions14
Ruby Completions48
COBOL Completions4
C Completions67
Go Completions22
Total Stars45
% of votes with a positive feedback rating96% of 302
Total "Very Satisfied" Votes278
Total "Somewhat Satisfied" Votes23
Total "Not Satisfied" Votes1
Total Rank Assessments6
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • myjinxin2015 Avatar
  • suic Avatar
  • anter69 Avatar
  • smile67 Avatar
  • rowcased Avatar
  • akar-0 Avatar
  • mauro-1 Avatar
  • VLS-v Avatar
Ad