Can you process it?

Count the total number of letter "F" in the following text:

FINISHED FILES ARE THE RESULT OF YEARS OF SCIENTIFIC STUDY COMBINED WITH THE EXPERIENCE OF YEARS...


This teaser is called "Alzheimer's' eye test".

5 4 3 6

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

10 solutions

Trevor B.
Aug 11, 2014

The key thing here is to find the three "F"s in the long words but not to miss the three "F"s in the word "of," which also appears three times. You might miss it if you read the sentence too quickly.


Alternatively,

1
2
string = "FINISHED FILES ARE THE RESULT OF YEARS OF SCIENTIFIC STUDY COMBINED WITH THE EXPERIENCE OF YEARS"
print string.count("F")

@Justin Wong It's more of a one-liner. Basically, string.count is the number of times the thing in parentheses appears in the string. It's the following condensed into one operation.

1
2
3
4
5
6
7
8
string = "FINISHED FILES ARE THE RESULT OF YEARS OF SCIENTIFIC STUDY COMBINED WITH THE EXPERIENCE OF YEARS"
Fcount=0

for i in range (0,len(string)):
    if string[i]=="F":
        Fcount=Fcount+1

print Fcount

Trevor B. - 6 years, 10 months ago

Log in to reply

Thanks for the tip! I was thinking copy paste into microsoft word lol

Justin Wong - 6 years, 10 months ago

Log in to reply

Same here. :D

Aloysius Ng - 6 years, 7 months ago

I just read it over letter by letter without reading using words. Couldn't fool me! :P

Gavin LO - 6 years, 5 months ago

its 4 simple

Rezwan Laskar - 6 years, 9 months ago
Justin Wong
Aug 10, 2014

Copy the text into a word processing program and then use the search function with Ctrl-F for the letter "f". A good program will tell you the number of occurrences.

Ctrl + F then find F. Count the highlighted letters. Problem solved

Danilo Azevedo
Oct 9, 2014

PHP:

<?PHP

$string = "FINISHED FILES ARE THE RESULT OF YEARS OF SCIENTIFIC STUDY COMBINED WITH THE EXPERIENCE OF YEARS...";

echo substr_count($string, "F");

?>
Kamble Sanjay
Sep 14, 2014

include<string.h>

int main() { int b,c=0; char a[]="FINISHED FILES ARE THE RESULT OF YEARS OF SCIENTIFIC STUDY COMBINED WITH THE EXPERIENCE OF YEARS"; for(b=0;b<strlen(a);b++) { if(a[b]=='F') c=c+1; printf("%d\n",c); }

return 0;

}

since everyone writes a code in his preferred language, here is my C++ code :D :

string s = "FINISHED FILES ARE THE RESULT OF YEARS OF SCIENTIFIC STUDY COMBINED WITH THE EXPERIENCE OF YEARS...";

int numb = 0;

for ( int i=0; i<s.size(); i++)
    if (s[i] == 'F')
        numb++;
cout << "Number of F: " << numb;

cout << endl;
return 0;

oh god.. C++ can you teach me ? :v

Muhammad Muhajir - 6 years, 9 months ago

python code for the problem

given = "FINISHED FILES ARE THE RESULT OF YEARS OF             SCIENTIFIC STUDY COMBINED WITH THE EXPERIENCE OF         YEARS..."
count = 0
for i in given:
    if i == 'F':
        count = count + 1

print count
Bill Bell
Aug 17, 2014

In a Python interactive window, such as PythonWin:

>>> "FINISHED FILES ARE THE RESULT OF YEARS OF SCIENTIFIC STUDY COMBINED WITH THE EXPERIENCE OF YEARS...".count('F')

6

(I wouldn't trust myself to count anything myself.)

Dwarfing trust of dilemma syndrome of over study.

Lu Chee Ket - 5 years, 7 months ago

Log in to reply

OK, I give up. What does that mean?

Bill Bell - 5 years, 7 months ago

Log in to reply

I thought the message was not sent as the internet at the moment could not run while I was trying to click.

Joke to you. Please don't be too serious.

Lu Chee Ket - 5 years, 7 months ago

Log in to reply

@Lu Chee Ket Don't worry. I'm rarely very serious. :)

Bill Bell - 5 years, 7 months ago

Log in to reply

@Bill Bell All right. I think this is how this question can bring people with happiness.

Lu Chee Ket - 5 years, 7 months ago
Parth Agarwal
Nov 22, 2015

In PYTHON:

  1. z = "FINISHED FILES ARE THE RESULT OF YEARS OF SCIENTIFIC STUDY COMBINED WITH THE EXPERIENCE OF YEARS..."
  2. x = z.count('F')
  3. print x
Arulx Z
Sep 1, 2015
1
'...'.count('F')

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...