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

 

String-3 > gHappy
prev  |  next  |  chance

We'll say that a lowercase 'g' in a string is "happy" if there is another 'g' immediately to its left or right. Return true if all the g's in the given string are happy.


gHappy("xxggxx") → true
gHappy("xxgxx") → false
gHappy("xxggyygxx") → false

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

public boolean gHappy(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: 312.0

Copyright Nick Parlante 2017 - privacy