Skip to content

Instantly share code, notes, and snippets.

View ironpython2001's full-sized avatar

Sunil P ironpython2001

  • OSI Digital
  • Hyderabad
View GitHub Profile
@ironpython2001
ironpython2001 / versionnocomp.cs
Last active May 5, 2022 08:04
version number comparison in c#
//Version 1 Version 2 Result
//1.11.17 2.3.5 2.3.5
//2.1 2.1.3 2.1.3
//2.3.5 2.4 2.4.0
//3.1 2.4 3.1.0
//3.3 3.2.9 3.3.0
//7.2.71 7.2.71 7.2.71
string s1 = "2.1";
@ironpython2001
ironpython2001 / checkwellformedbracing.cs
Last active May 2, 2022 13:48
check well formed bracing in c#
/*
check wellformedbracing
Input Result Comment
“(( ))” True
“( )( )” True
“(( )))((( ))” False Although it has the same amount of opening and closing braces,
it is not properly nested
“((( )” False No suitable bracing
@ironpython2001
ironpython2001 / joinlistofstringswithdelimeter.cs
Created April 29, 2022 13:59
C# join list of strings with delimeter
/*
Input : [“hello”, “world”, “message”]
Separator: “ +++ ”
Result: “hello +++ world +++ message”
*/
using System;
using System.Collections.Generic;
var input = new List<string>{"hello","world","message"};
@ironpython2001
ironpython2001 / longestpalindromesubstring.cs
Last active April 29, 2022 09:51
Given a string s, return the longest palindromic substring in s. using C# and Dotnet
/*
Given a string s, return the longest palindromic substring in s.
Example 1:
Input: s = "babad"
Output: "bab"
Explanation: "aba" is also a valid answer.
Example 2:
Input: s = "cbbd"
Output: "bb"
*/