**Problem Link:**

CONTEST

PRACTICE

**Author-** Kushank Arora

**Tester-** Sameer Taneja

**Editorialist-** Kushank Arora

**Difficulty:**

Simple

**Prerequisites:**

Nothing except coding is required

**Problem:**

The aim is to find the number of spaces in the given sentence.

**Explanation:**

The problem is to find the number of spaces in the sentence which could be done if we iterate over the string and check if each character is space or not, if it is space, a variable count is incremented to keep the note of the number of spaces.

Firstly use a proper method to input a sentence. To find the number of spaces, a simple algorithm could be used:

count = 0

for i to len(str):

if str[i] = ‘ ‘:

count = count + 1

Thus, count contain the number of spaces, len is the method to find the length of the string.

**Solution**

http://ideone.com/wkWzAe