NoRepeatsPlease
How do I make an norepeatsplease?
What is a norepeatsplease? How do you make a norepeatsplease? This script and codes were developed by Ben on 12 August 2022, Friday.
NoRepeatsPlease - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>NoRepeatsPlease</title>
</head>
<body> <script src="js/index.js"></script>
</body>
</html>
NoRepeatsPlease - Script Codes JS Codes
function permAlone(str) { debugger var arr = str.split(''), permutations = []; function swap(a, b) { var tmp = arr[a]; arr[a] = arr[b]; arr[b] = tmp; } function generate(n) { if (n == 1) { permutations.push(arr.join('')); } else { for (var i = 0; i != n; ++i) { generate(n - 1); swap(n % 2 ? 0 : i, n - 1); } } } generate(arr.length); //permutations.map(arr => arr.join('')) permutations=permutations.filter(stri => !(stri.match(/([a-zA-Z])\1+/))) return permutations.length;
}
console.log(permAlone('aab'));
console.log(permAlone("aab")) //should return a number.
console.log(permAlone("aab")) //should return 2.
console.log(permAlone("aaa")) //should return 0.
console.log(permAlone("aabb")) //should return 8.
console.log(permAlone("abcdefa")) //should return 3600.
console.log(permAlone("abfdefa")) //should return 2640.
console.log(permAlone("zzzzzzzz")) //should return 0.
permAlone("a") //should return 1.
permAlone("aaab") //should return 0.
permAlone("aaabb") //should return 12.
Developer | Ben |
Username | bencarp |
Uploaded | August 12, 2022 |
Rating | 3 |
Size | 1,668 Kb |
Views | 42,504 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Symmetric Difference | 1,747 Kb |
DalaiLamasQuotes | 2,776 Kb |
SumAllPrimes | 1,518 Kb |
Calc Bootstrap | 1,565 Kb |
TESTS | 1,379 Kb |
GreenPedia | 2,410 Kb |
Weather App | 2,721 Kb |
MakeAPerson | 1,763 Kb |
Smallest Common multiple | 2,035 Kb |
About Me Page | 3,220 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Simple Carousel Pure CSS | Dangvanthanh | 4,080 Kb |
SVG Basics | HipsterBrown | 1,852 Kb |
Flex layout example | Mofny | 1,663 Kb |
GLSL Hills | Ykob | 6,991 Kb |
Tooltip in table | Roine | 3,713 Kb |
Adding Items | Valhead | 4,008 Kb |
RWD- Mostly Fluid Layout Pattern | Marcocastro | 2,312 Kb |
Alter bg opacity on hover... | Chrisboon27 | 2,054 Kb |
Playing with transition timing | Mattgrosswork | 1,993 Kb |
Price Comparison Table | Orrinward | 3,459 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!