7 kyu

Pillow on the Fridge

308 of 765PG1

Description:

Apparently "Put A Pillow On Your Fridge Day is celebrated on the 29th of May each year, in Europe and the U.S. The day is all about prosperity, good fortune, and having bit of fun along the way."

All seems very weird to me.

Nevertheless, you will be given an array of two strings (s). First find out if the first string contains a fridge... (i've deemed this as being 'n', as it looks like it could hold something).

Then check that the second string has a pillow - deemed 'B' (struggled to get the obvious pillow-esque character).

If the pillow is on top of the fridge - it must be May 29th! Or a weird house... Return true; For clarity, on top means right on top, ie in the same index position.

If the pillow is anywhere else in the 'house', return false;

There may be multiple fridges, and multiple pillows. But you need at least 1 pillow ON TOP of a fridge to return true. Multiple pillows on fridges should return true also.

100 random tests

Fundamentals
Strings
Arrays

More By Author:

Check out these other kata created by PG1

Stats:

CreatedSep 8, 2016
PublishedSep 8, 2016
Warriors Trained1404
Total Skips15
Total Code Submissions4659
Total Times Completed765
JavaScript Completions308
Python Completions395
Ruby Completions74
Haskell Completions40
Total Stars19
% of votes with a positive feedback rating87% of 235
Total "Very Satisfied" Votes187
Total "Somewhat Satisfied" Votes33
Total "Not Satisfied" Votes15
Total Rank Assessments16
Average Assessed Rank
7 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • PG1 Avatar
  • GiacomoSorbi Avatar
  • cliffstamp Avatar
  • ejini战神 Avatar
  • Just4FunCoder Avatar
Ad