JavaScript Algorithms

Algorithms: Name Swap, Palindrome, Reverse String, Repeat String


By YunaAnn

Reverse String

EXAMPLE

cat -> tac
lovely -> ylevol

RESULT

------------

Alphabetize String

EXAMPLE

cat -> act
rain -> ainr

RESULT

------------

Repeat String

EXAMPLE

cat, 5 -> catcatcatcatcat
rain, 4' -> rainrainrainrain

RESULT

------------

Name Swap

EXAMPLE

Doe Jane -> Jane Doe
Nowak Jan -> Jan Nowak

RESULT

------------

Palindrome

EXAMPLE PALIDROMES

Never odd or even
Do geese see God?

RESULT (true/false)

------------

Find the Longest String

EXAMPLE

1. Hello, what's up? -> Hello
2. I like trains :3 -> trains

RESULT

------------

Find the Largest Value

EXAMPLE

1. 1,3,10,4,6,7,8 -> 10
2. 302,17,35,66,100,1 -> 302

RESULT

------------

Find the Smallest Value

EXAMPLE

1. 1,3,10,4,6,7,8 -> 1
2. 302,17,35,66,100,1 -> 1

RESULT

------------

by YunaAnn

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy