MCPcopy Create free account
hub / github.com/careercup/ctci / code

Method code

java/Chapter 17/Question17_5/Question.java:24–37  ·  view source on GitHub ↗
(char c)

Source from the content-addressed store, hash-verified

22 };
23
24 public static int code(char c) {
25 switch (c) {
26 case 'B':
27 return 0;
28 case 'G':
29 return 1;
30 case 'R':
31 return 2;
32 case 'Y':
33 return 3;
34 default:
35 return -1;
36 }
37 }
38
39 public static int MAX_COLORS = 4;
40

Callers 1

estimateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected