Another wonderful HackerRank solution – Jumping on Clouds
Counting valleys from HackerRank
This problem left me day dreaming, such a beautiful description :)))) Open post to view the solution. I made two different solutions. Please leave feedback 🙂
Checking if two words are Anagram
Anagram means two words having same number of letters like Dormitory and Dirty room. The solution is actually very simple. We have to strip each string from everything except letters using regex, than we have to bring them to lower case, and then we can sort them!!!! By sorting two different words will became same … Continue reading Checking if two words are Anagram
Flattening the array and array chunking
Finding the longest word in a string
Finding a max character and a classic FizzBuzz
Finding max character in the string: (please open the post to view the solution) Here is the solution for classic FizzBuzz problem:
Palindrome challenge and capitalizing letters
We need to check if the string is a palindrome. Please open the post to see the solution; And here is how we can capitalize first letters of each word:
Reverse a string and a number :)
Very simple using built in array methods! Please open post to see the solution Reverse any number in JS. Please open the post to see the solution! using console.log after each method:
Sock Merchant Solution
Problem: John works at a clothing store. He has a large pile of socks that he must pair by color for sale. Given an array of integers representing the color of each sock, determine how many pairs of socks with matching colors there are. For example, there are n=7 socks with ar=[1,2,1,2,1,3,2] colors . There is one pair … Continue reading Sock Merchant Solution