You are viewing a single comment's thread. Return to all comments →
Worst solution ever with typescript
function birthday(s, d, m) { var count = 0; var beggining = 0; var success = 0; for (var i = 0; i < s.length; i++) { count = 0; beggining = 0; if (s.length == 1 && s.length == m && s[i] == d) { success++; break; } for (var j = i + 1; j <= s.length; j++) { count++; beggining = beggining + s[j - 1]; if (count == m && beggining == d) { success++; break; } } } return success; }
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
Subarray Division
You are viewing a single comment's thread. Return to all comments →
Worst solution ever with typescript