Skip to content

Instantly share code, notes, and snippets.

@w3cj
Created December 1, 2015 20:04
Show Gist options
  • Save w3cj/05f0f3c043590fc39752 to your computer and use it in GitHub Desktop.
Save w3cj/05f0f3c043590fc39752 to your computer and use it in GitHub Desktop.

Challenge 1: Count It

count the letters in a string.

Input

A string - like "Hello World"

Output

Letters and how often they show up. - d:1 e:1 h:1 l:3 o:2 r:1 w:1

Special

convert all to lowercase. Ignore whitespace and anything not a-z

Challenge input:

"The quick brown fox jumps over the lazy dog and the sleeping cat early in the day."

Source


Challenge 2: Ramp Numbers

A ramp number is a number whose digits from left to right either only rise or stay the same. 1234 is a ramp number as is 1124. 1032 is not.

Input

A positive integer, n.

Output

true if the input is a ramp number, false if it is not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment