All Questions
Tagged with functional-programming array
28
questions
3
votes
4
answers
1k
views
Merging sorted integer arrays (without duplicates)
I have written a Python function called merge_arrays which takes two lists and returns the new list merge without duplicate.
The function works as expected, but my ...
2
votes
1
answer
124
views
3
votes
1
answer
73
views
Dyalog APL dyadic operator deriving ambivalent function to pair two function results
I'm writing a small utility operator which applies two functions to an argument pair and strands the results. The pair can either be given as two arguments or as a single argument with two elements. ...
1
vote
1
answer
52
views
Optimizing the Dig Pow function
I have written a Python function to solve the Dig Pow problem, where the goal is to find a number k such that the sum of each digit of n raised to a specific and ...
1
vote
1
answer
113
views
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 ...
1
vote
2
answers
199
views
Simplify a function which performs manipulation of data in Javascript
Upon suggestion in the original question within Stack Overflow, I'm bringing my question here.
We have created a function that will convert the data into the desired format, but it has a lot of code ...
1
vote
1
answer
297
views
Suggestions for improvement for generic array and map functions in Go 1.18
Yesterday I build some generic functions for the new official Golang 1.18 release. What do you think about it and what could be added and improved?
...
11
votes
4
answers
3k
views
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:
...
0
votes
2
answers
79
views
Functional Programming Style in Javascript Picking a Random Item from an Array
I'm trying to understand the Functional Programming Paradigm (or style) implemented with Javascript. There are a few things I have difficulties with. The naming conventions, and dependency injections. ...
1
vote
1
answer
101
views
JavaScript, looping, and functional approach
Data Structure coming back from the server
...
6
votes
3
answers
1k
views
Finding even or odd numbers
I'm looking for critiques to see what I could have done better or different ways I could approach writing a script for finding even or odd numbers. I am new to programming with JavaScript, and ...
13
votes
5
answers
3k
views
Vue.js search functionality
In my BlogList.vue component I made a search input field:
...
0
votes
1
answer
45
views
0
votes
3
answers
278
views
Finding nth lowest value without any Math max or min methods
So I decided to make a more efficient solution to a Google interview question where they ask you to either find the lowest or second lowest value in an array without using the max or min methods. I ...
4
votes
2
answers
438
views
Replace array element with multiplication of neighbors in Scala
Given an array of integers, update the index with multiplication of previous and next integers,
Input: 2 , 3, 4, 5, 6
Output: 2*3, 2*4, 3*5, 4*6, 5*6
Following ...