Problem of the Day
Tuesday, December 16, 2025
Problem:
During the Jewish festival Hannukah, the dreidel game is played with a small, four-sided, spinning top. Each of the four faces is imprinted with a Hebrew letter, and when the top is spun, one of the four letters will land face up. Hebrew letters can be displayed in a webpage by using a numeric character reference according to the table here.
| Letter Name | Hebrew Letter | HTML reference |
| "Nun" | נ | נ |
| "Gimel" | ג | ג |
| "He" | ה | ה |
| "Shin" | ש | ש |
What does the method d given here do?
public static String d(String letter)
{
String[] let = {"Nun", "Gimel", "He", "Shin"};
String[] cod = {"נ", "ג", "ה", "ש"};
for (int i = 0; i < let.length; i++)
if (let[i].equals(letter))
return cod[i];
return null;
}
- Identifies the HTML code for a given LetterName
- Identifies the HTML code for a given Hebrew letter
- selects a random Hebrew letter
- selects a random HTML reference for a Hebrew letter
The correct answer is a. The parameter letter is compared with the list of legal letters in the array let, and the corresponding HTML reference from the array cod is returned, or null if a legal match isn't found.