Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
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 ...
Milliorn's user avatar
  • 610
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, ...
Kunal Mukherjee's user avatar
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 ...
downrep_nation's user avatar
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? ...
good-to-know's user avatar
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. ...
Jens's user avatar
  • 195
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: ...
Nick Kahn's user avatar
  • 259
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: ...
ElektroStudios's user avatar
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 ...
Robert Snyder's user avatar