Skip to main content

All Questions

2votes
0answers
733views

Determine whether there exists a one-to-one character mapping from one string to another

The task Determine whether there exists a one-to-one character mapping from one string s1 to another s2. For example, given s1 = abc and s2 = bcd, return true since we can map a to b, b to c, and c ...
4votes
2answers
192views

Abundant number implementation

I have implementted a simple JavaScript function to find the list of abundant numbers and print them on the screen. an abundant number is a number for which the sum of its proper divisors is greater ...
4votes
2answers
3kviews

Download entire localStorage as file

I would like to download the entire contents from localStorage to a json file (in a "clear" formatting). I've tried this and it works perfectly. However, ...
1vote
1answer
140views

Transform an array into object and set index for an unique key in javascript

I have a method that merges keys and indexes from an array into an object. I'm stuck with ways to compress this method, and I don't know what I can do to make it simpler. Goal get an array of objects ...
2votes
1answer
2kviews

Find common characters (LeetCode)

The task is taken from leetcode Given an array A of strings made only from lowercase letters, return a list of all characters that show up in all strings within the list (including duplicates). ...
0votes
2answers
84views

Processing list of users- filtering out from refused list

The code below takes a list of users and displays two lists Refused users Admitted users Sample output: Refuse: Phil, Lola. Admit: Chris, Anne, Colin, Terri, Sam, Kay, Bruce. Any feedback is ...
7votes
1answer
4kviews

Given a string containing just parentheses, determine if the input string is valid

The task is taken from leetcode Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: ...
-2votes
2answers
111views

Getting items that have more than one entry in the array with optimized code

...
1vote
1answer
1kviews

Find busiest period in building

The task You are given a list of data entries that represent entries and exits of groups of people into a building. An entry looks like this: {"timestamp": 1526579928, count: 3, "type": "...
13votes
5answers
3kviews

Vue.js search functionality

In my BlogList.vue component I made a search input field: ...
11votes
4answers
3kviews

Restructuring JSON to create a new JSON where properties are grouped according to similar values

I have a JSON structure in the following example format: ...
4votes
2answers
4kviews

Return the first word with the greatest number of repeated letters

I'm learning JavaScript and have written a function that accepts a string and returns the first word with the greatest number of repeated letters. For example: Input:"Hello apple pie" - Output:"Hello"...
7votes
3answers
1kviews

Counting words from stored .md files

The following searches recursively for all the mark down files - i. ending with the extension .md - inside a folder. It then stores the text of the files in an ...
6votes
4answers
3kviews

Convert minutes portion of time to decimal

I am making an hours calculator app. It takes a start time, end time and time taken for lunch. For the start and end time it takes a four-digit hh:mm time. For example: 10:20. I have made a function ...
5votes
3answers
112views

Aggregate summary counts for an array of error objects

I'm doing some refactoring of someone else's code, and just want a second opinion, because of course I think my work makes it better, but some validation (or correction) would be helpful. Starting ...

153050per page
close