All Questions
8 questions
6
votes
5
answers
1k
views
Find greatest number in array that is a product of some two elements in the same array
Given an array a, find the greatest number in a that is a product of two elements in a. If there are no two elements in a that can be multiplied to produce another element contained in a, return -1.
I ...
5
votes
1
answer
127
views
Algorithm for tagging list of substrings from a list of strings
I have a list of utterances(strings)/corpus as the follows,
...
2
votes
1
answer
1k
views
Unfold a 2D array spiral in C#
The purpose of this function is to turn a 2D array of sorts into a single-dimensional array by reading it in a spiral fashion.
In the array:
1 2 3
4 5 6
7 8 9
...
0
votes
1
answer
16k
views
Remove particular element from an array and return indices of other elements
I'd like to get the indices of elements of an array with particular element. Is it okay or, or how can I make it even better?
...
6
votes
2
answers
253
views
Inversion of an array that contains indices
I have an array of length n that contains numbers from 0 to n-1 in random order.
I now want to "inverse" this array to one that where index i corresponds to the location of i in the source array.
...
3
votes
2
answers
1k
views
How to get the Split value from collection?
I have the following key value pair in an array, and am trying to extract and load them into a collection.
The below code is working but it can be optimized using Linq:
...
2
votes
3
answers
2k
views
Add item to an Array 2D using LINQ
I've wrote a generic function to add an item to an Array 2D
This is what I have:
...
2
votes
1
answer
714
views
XML to Windows.Forms.Keys List
It took me a lot of poking around and unit testing to get the code to look like it is right now. So I have a XML file which in part looks like this
...