id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

amjadm@miamioh.edu assignmentiii > doubleHi
prev  |  next  |  chance

Given a string, return true if word "Hi" is repeated 2 times in the string."H" and "i" could be together or separated.
Hint: loop through the string, every time check two characters to see if they are "h" and "i". If they are, then return true, otherwise check the next two characters, and keep doing this until it gets to the end of string. And since you couldn't find anything, you should return false.


doubleHi("HiHi") → true
doubleHi("") → false
doubleHi("Hkji3Hi") → true

...Save, Compile, Run (ctrl-enter)

public boolean doubleHi(String str) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 195

Copyright Nick Parlante 2017 - privacy