This repository contains a collection of problems and their corresponding solutions. Click on the solution link to navigate to the respective solution file.
- Write a function that returns the reverse of a string ?
- Write a function that returns the longest word in the sentence.
- Write a function that checks a given string is a palindrome or not ?
- Write a function to remove duplicate elements from an array.
- Write a function that checks whether two string are anagrams or not ?
- Write a function that returns the number of vowels.
- Write a function to find the largest number in an array.
- Write a function to check if a given number is prime or not ?
- Write a function to calculate the factorial of a number.
- Write a program to remove white space characters from the given strign.
- Write a function that counts the frequency of all the characters in a given string.
- Write a function that given an input URL, returns its domain name.
- Write a function that accepts two strings and returns true if some or all of the characters in the first string can be rearranged to match the second string.
- Write a function that turns a given string into a wave! You will be passed a string and you must return that string in an array where each letter takes turns to become uppercase. The input string will always be lowercase
- Write a function that take some sort of string like
hi my name is jhon
and return the full string with first letter capitalize
- Given an integer array nums, move all 0's in the array to the end of it while maintaining the relative order of the non-zero elements. Achieve this without copying the array or creating a new array.
- Write a function that given an integer array nums of length n, returns an array of length 2n where nums is concatenated to itself.
- Complete the solution so that the function will break up camel casing, using a space between words.
- Count Characters in Your String.
- The marketing team is spending way too much time typing in hashtags. Let's help them with our own Hashtag Generator! Here's the deal:
- Create a function that checks if a number n is divisible by two numbers x AND y. All inputs are positive, non-zero digits.
- Nathan loves cycling. Because Nathan knows it is important to stay hydrated, he drinks 0.5 litres of water per hour of cycling. Given the time in hours, you need to return the number of litres of water that Nathan will drink, rounded to the smallest value.
- Given a word, your job is to return the middle character(s) of the word. If the word's length is odd, return the middle character. If the word's length is even, return the middle 2 characters.
- You probably know the "like" system from Facebook and other social media. People can "like" posts, photos or other items. We want to create the text that should be displayed next to such an item. Implement a function that takes an input array, containing the names of people who like an item and returns an output string formatted nicely as shown below.
- Write a function that accepts an array of 10 integers (between 0 and 9), and returns a string of those numbers in the form of a phone number.
- Given an integer, your task is to square every digit of it and concatenate them to produce a new integer.
- Given a string of space-separated numbers, write a function that returns the highest and lowest numbers. There will always be at least one number in the input string.
- Write a function that takes any non-negative integer as an argument and returns it with its digits in descending order. Essentially, rearrange the digits to create the highest possible number.