Caesars Cipher

Convert string str into ROT13 cipher string. Returned string must be all uppercase letters.

My approach

function rot13(str) {
  return str.split('').map(char => rot(char)).join('')

  function rot(char) {
    const alphabets = …

Roman Numeral Converter


Write a function that takes number num and return corresponding Roman numeral.

For how Roman numeral works, see here.

My approach

function convertToRoman(num) {

    function getQuot(quot, dec) {
        let lowDec, fifth, highDec;
        switch (dec) {
            case …

Leap year


Write a python function that takes year and return True if it's leap year, False otherwise.

There are three conditions to determine whether it's leap year or not. Leap year is

  1. evenly divided by 4.
  2. And it is not evenly divided by 100.
  3. Even if the second condition fails, …

Palindrome Checker


Return true if string str is palindrome, false otherwise.

What is Palindrome?

According to wikipedia,

A palindrome is a word, number, phrase, or other sequence of characters which reads the same backward as forward, such as madam or racecar. There are also numeric palindromes, including date/time stamps using …

Map the Debris challenge


Given GM and radius r of Earth, take an array arr and return a new array where each item has corresponding key orbitalPeriod and its value pair. The value should be rounded to the nearest number.



orbitalPeriod([{name : "sputnik", avgAlt : 35873.5553 …