Longest Common Prefix

Write a program to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string ” “. Example 1: Input: [“geeksblood”, “geeks”, “geek”] Output: “geek” Example 2: Input: [“abc”,”xyz”,”pqr”] Output: “” Explanation: There is no common prefix among the input strings. Implementation: class Program { […]

Read More

Difference between string and String in C#

string is an alias in C# for System.String. So technically, there is no difference. It’s like int vs. System.Int32.You can use whichever you prefer, although I generally use string when I’m planning on using it much like a primitive data type (similar to int, float, or bool) and String when I’m planning on using it […]

Read More