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

Method letterFromCode

java/Chapter 17/Question17_5/Question.java:73–86  ·  view source on GitHub ↗

TEST CODE

(int k)

Source from the content-addressed store, hash-verified

71 /************************** TEST CODE **********************************/
72
73 public static char letterFromCode(int k) {
74 switch (k) {
75 case 0:
76 return 'B';
77 case 1:
78 return 'G';
79 case 2:
80 return 'R';
81 case 3:
82 return 'Y';
83 default:
84 return '0';
85 }
86 }
87
88 public static Result estimateBad(String g, String s) {
89 char[] guess = g.toCharArray();

Callers 1

randomStringMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected