Posts List

JavaScript Algorithms Part 4. MAXIMUM CHARACTER

Image credits: Pixelstalks Question Write a function to return the maximum occurring character in the input string e.g., if input string is “Test” then function should return ‘t’. Note: capital letter ‘T’ and small letter ‘t’ should count as the same. In writing a function to satisfy the above question, the first thing to do is to change every input entered by the user to lower case. Let us consider the string ‘Test’, our expected result is that the letter ‘t’ should return 2, the letter ‘e’ and ‘s’ should return 1.

JavaScript Algorithms Part 3. FIZZBUZZ

JavaScript Algorithms Part 3. FIZZBUZZ Image Credits: The FizzBuzz algorithm question is one very popular algorithm problem lots of folks would have to solve, in fact, it is a very popular interview question for programmers. Question. Write a program that prints the numbers from 1 to n. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”


Image Credits: CarfromJapan To solve the reversed integer and reversed string algorithms, we would need to refer to some of the Logic we used in Part 1 of this series, click here to see the post. I’d be dealing with the more complex algorithm which is reversing an integer before solving reversing a string, in fact, if you can reverse an integer you should have no problem reversing a string.

JavaScript Algorithms Part 1 PALINDROME

Image Credits: Zooglobble Welcome to the part 1 series of JavaScript Algorithms. I’m so glad to be doing this and I’m pretty sure you’re in for an amazing ride. All solution and test code for my JavaScript Algorithm Challenge can be found here: The Palindrome question is a very popular algorithm question asked during interviews and it is probably one of the first challenges you’d have to deal with when you start out as a programmer, I’d be sharing my thought process on solving this question.