You are viewing a single comment's thread. Return to all comments →
C# (of course I wouldn't do something like that in real life :D)
public static string hackerrankInString(string s) { string word = "hackerrank"; int i = 0; foreach (char c in s) { if (i == 9 && c == 'k') return "YES"; if (c == word[i]) i++; } return "NO"; }
Seems like cookies are disabled on this browser, please enable them to open this website
HackerRank in a String!
You are viewing a single comment's thread. Return to all comments →
C# (of course I wouldn't do something like that in real life :D)