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

 

james.shockey@austinisd.org > compliance
prev  |  next  |  chance

Problem Description Coral Code Compliance

An oceanic data repository contains access codes that must comply with specific validation rules. The rules specify a range and a required character, and an access code is valid if the required character appears within the specified range.

Given a list of strings in the format "{min}-{max} {char}: {access_code}", determine the number of valid access codes.


compliance(["1-4 r: reef", "2-5 c: corals", "1-3 o: ocean", "3-6 t: turtle", "5-8 e: eel", "2-4 m: marine"]) → 2
compliance(["1-2 a: aquarium", "3-4 b: bubbles", "2-3 s: sharks"]) → 3
compliance(["1-5 x: xylophone", "2-4 c: coral", "3-6 m: manta"]) → 1

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

public int compliance(String[] accessCodes) { }

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

Copyright Nick Parlante 2017 - privacy