Monthly Archives: September 2015

Increment a number represented by an array of digits by 1

Given an integer array of variable length like [9, 8, 8, 3] where each item could be 0 to 9, write a function that would interpret the array [9, 8, 8, 3] as a number 9883 and increment it by … Continue reading

Posted in Information Technology | Leave a comment

Detect the window length with highest number of distinct characters

In a string detect the window length with highest number of distinct characters. For example if A = “aabcbcdbca”, then output should be 4 corresponding to sub string “dbca”. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Collections; namespace … Continue reading

Posted in Information Technology | Leave a comment

Number List Compression

Input: Sorted number list 1, 2, 3, 10, 25, 26, 30, 31, 32, 33 Output: Merge consecutive segments 1-3, 10, 25-26, 30-33 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Collections; namespace ConsoleApplication1 { class Program { static void … Continue reading

Posted in Information Technology | Leave a comment

Visual Studio 2015 Error: CS0246 The type or namespace name ‘Hashtable’ could not be found

If you are facing this error, just delete the following from project.json file , “dnxcore50”: { “dependencies”: { “System.Collections”: “4.0.10-beta-23019”, “System.Console”: “4.0.0-beta-23019”, “System.Linq”: “4.0.0-beta-23019”, “System.Threading”: “4.0.10-beta-23019”, “Microsoft.CSharp”: “4.0.0-beta-23019” } } This file can be found under project src folder.

Posted in Information Technology | Leave a comment