Java Sandwich


Premium Content - Free Preview

Time for some more challenging problems!

A "Java Sandwich" is a String that contains the word "Java" near the middle of it. "Near" means that the number of characters to the right and left differ by at most 2 characters.


End of Free Content Preview. Please Sign in or Sign up to buy premium content.

Comments

  • Uhm a space is not a character right?

  • It shouldn't make a difference in this challenge, but a space is a character just like any other.

  • Thx
    it does matter since i have to count them in, right.

  • Yes that's correct, you need to count the spaces. (I thought there were the same number of spaces on each side, but I see that's not the case.)

  • I solved it, but i stil get wrong output one 1 item. The fault is not my code this thime! check it.

    for 12Java12345 i get true and i thould be false. When i run it in eclips it gives false ( so its not my code).
    what is going wrong?

Contact Us
Sign in or email us at [email protected]