Waste less time on Facebook — follow Brilliant.
Back to all chapters


Strings are basically "words in computers". As an ordered set of characters, these are the building blocks that allow us to do things from searching filesystems to decrypting ciphers.

Strings - Basic


Write a program to decide if a string is a palindrome or not. Is the following string a palindrome?


Write a function that returns number of times a substring occurs in a string.

In the string below how many times does the string "EAT" occur?


Given an ASCII string, find the sum of all the numeric characters in the string. For example, for 'abc1234z' the sum of all numeric characters is \(1 + 2 + 3 + 4 = 10\). What is the sum of all the numeric characters in the string below?


Problem Loading...

Note Loading...

Set Loading...