Skip to content

Instantly share code, notes, and snippets.

@brijeshb42
Created July 19, 2013 14:00
Show Gist options
  • Save brijeshb42/6039309 to your computer and use it in GitHub Desktop.
Save brijeshb42/6039309 to your computer and use it in GitHub Desktop.
FB Coding Round Question 1
A sstring is a string which comprises of only lowercase letters and in which no two consecutive letters are the same.
You are given a string (length <= 100). Print the number of sstrings lower than the given string and of the same length.
Input: Only 1 line which is the given string (all lowercase letters).
Output: Number of sstrings lower than the given string of the same length.
Sample Input:
bcd
Sample Output:
653
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment