Skip to content

Instantly share code, notes, and snippets.

Avatar
😷

Mohammad Sufyan Al Yousufi ymohammad

😷
  • Hyderabad, India
View GitHub Profile
View bonfire-confirm-the-ending?solution=function%20end(str%2C%20target)%20%7B%0A%20%20%2F%2F%20%22Never%20give%20up%20and%20good%20luck%20will%20find%20you.%22%0A%20%20%2F%2F%20--%20Falcor%0A%20%20var%20returnValue%20%3D%20false%3B%0A%20%20if(str.indexOf
// Bonfire: Confirm the Ending
// Author: @ymohammad
// Challenge: http://www.freecodecamp.com/challenges/bonfire-confirm-the-ending?solution=function%20end(str%2C%20target)%20%7B%0A%20%20%2F%2F%20%22Never%20give%20up%20and%20good%20luck%20will%20find%20you.%22%0A%20%20%2F%2F%20--%20Falcor%0A%20%20var%20returnValue%20%3D%20false%3B%0A%20%20if(str.indexOf(target)%20!%3D%20-1)%20%7B%0A%20%20%20%20%0A%20%20%20%20var%20newStr%20%3D%20str.substr(str.lastIndexOf(target))%3B%0A%20%20%20%20if(newStr.length%3D%3D%3Dtarget.length)%20%7B%0A%20%20%20%20%20%20returnValue%20%3D%20true%3B%0A%20%20%20%20%7D%0A%20%20%20%20%0A%20%20%7D%20%0A%20%20return%20returnValue%3B%0A%7D%0A%0Aend(%22Bastian%22%2C%20%22n%22)%3B%0A
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function end(str, target) {
// "Never give up and good luck will find you."
// -- Falcor
var returnValue = false;
if(str.indexOf(target) != -1) {
@TSiege
TSiege / The Technical Interview Cheat Sheet.md
Last active Oct 20, 2021
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.
View The Technical Interview Cheat Sheet.md

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\