All Questions
Tagged with programming-challenge javascript
291 questions
1
vote
1
answer
158
views
FreeCodeCamp todo list
I'm writing JS for the FreeCodeCamp todo list; the corresponding HTML and CSS for this can be found on their page. I have made one edit to the HTML - the button with type "submit" has been ...
3
votes
2
answers
96
views
Optimizing a Function to Check Pronic Numbers in JavaScript
I've written a function in JavaScript to check whether a given number is a Pronic number. A Pronic number, also known as an oblong number, rectangular number, or ...
4
votes
2
answers
70
views
Optimizing a Function to Generate a Row of Consecutive Odd Numbers in a Triangle
I've written a JavaScript function that generates a row of consecutive odd numbers in a triangle. The triangle looks like this:
...
0
votes
1
answer
104
views
Advent of Code 2023 day 1: Trebuchet in JS, part 2
The task involves analyzing a bunch of lines containing lines of text. Each line represents a calibration value that needs to be recovered by extracting the first and last digits and combining them ...
2
votes
1
answer
84
views
Advent of Code 2023 day 1: Trebuchet in JS
The task involves analyzing a bunch of lines containing lines of text. Each line represents a calibration value that needs to be recovered by extracting the first and last digits and combining them ...
1
vote
1
answer
77
views
String represents a road. One character travels on the road obeying the stops - Code challenge (advent.js day 5)
This is my code to solve the 5th Adventjs challenge. In that link you can read the instructions.
How can I improve it? It's a bit messy... and I'm repeating some part of the code.
All must be in just ...
3
votes
2
answers
340
views
Given an array, remove zero or more elements to maximize the reduction where you add odd values and subtract even values
Here's a code challenge I got. (I could not solve the challenge, I ran out of time. I rephrased the challenge language and I am trying the challenge again for personal growth & computer science ...
1
vote
2
answers
600
views
Split the Bill and calculate the Tip
I have created a Bill Splitter page that asks for the total bill amount, tip percentage, and the number of people. Then it displays the tip and the total amount (including the tip) each person has to ...
0
votes
1
answer
136
views
Using JavaScript to interface with REST APIs
The website TryHackMe came up with a challenge that involves using HTTP requests to interface with REST APIs (here, task #14/day 9). The challenge basically involves querying a basic REST API to ...
1
vote
2
answers
198
views
Implementation of aho corasick algorithm - slow suffix construction
EDIT: Dequeu was the correct guess
EDIT: I did the BFS method for the suffix link/output link construction
I'm doing a hackerrank challenge and I came up with this implementation of the aho corasick ...
3
votes
1
answer
49
views
Generate total property sold for given postcode
I had to implement the below as a coding challenge.
There are two http endpoints. The first http endpoints returns a list of postcodes. The second http endpoint takes a postcode as a parameter and ...
1
vote
2
answers
1k
views
Leetcode 55. Jump Game solution
I was working on Jump Game problem on leetcode
Question
You are given an integer array nums. You are initially positioned at the array's first index, and each element in the array represents your ...
1
vote
1
answer
230
views
JavaScript function that generates Fibonacci like sequences of given order
Generalizations of Fibonacci numbers
Fibonacci numbers of higher order
A Fibonacci sequence of order \$n\$ is an integer sequence in which each
sequence element is the sum of the previous \$n\$
...
3
votes
1
answer
159
views
A simple JavaScript function that does prime factorization
This is a simple JavaScript function that does prime factorization.
I wrote it on an Android phone with online editor (I don't have access to computers in night time):
Code:
...
2
votes
2
answers
1k
views
FizzBuzz in JavaScript (node.js), my first JavaScript program
I had just decided to learn JavaScript, so I wrote this program. I am sure you know what FizzBuzz is so I wouldn't describe it here.
Console output:
...