Last active
September 10, 2025 00:14
-
-
Save jacob-acusensus/ad780228a561dc44bc9b96e8d4b1ad9d to your computer and use it in GitHub Desktop.
Acusensus Graduate Application Question
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| std::string TestFunction() | |
| { | |
| std::string result; | |
| char c1 = 'a' + 125 % 50 - 1; | |
| char c2 = 'a' + 0b0101 - 1; // 0b == binary literal | |
| char c3 = 't' - 1; | |
| result.push_back(c1); | |
| result.push_back(c2); | |
| result.push_back(c3); | |
| result.insert(0, 1, toupper(c2)); | |
| return result; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private static string TestFunction() | |
| { | |
| string result = string.Empty; | |
| char c1 = (char)('a' + 125 % 50 - 1); | |
| char c2 = (char)('a' + 0b0101 - 1); // 0b == binary literal | |
| char c3 = (char)('t' - 1); | |
| result += c1; | |
| result += c2; | |
| result += c3; | |
| return result.Insert(0, c2.ToString().ToUpperInvariant()); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private static String TestFunction() | |
| { | |
| String result = ""; | |
| char c1 = 'a' + 125 % 50 - 1; | |
| char c2 = 'a' + 0b0101 - 1; // 0b == binary literal | |
| char c3 = 't' - 1; | |
| result += c1; | |
| result += c2; | |
| result += c3; | |
| return Character.toUpperCase(c2) + result; | |
| } |
Comments are disabled for this gist.