Skip to content

Commit 8b98ee8

Browse files
committed
005
1 parent 9d0073f commit 8b98ee8

File tree

7 files changed

+43
-4
lines changed

7 files changed

+43
-4
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -250,3 +250,4 @@ paket-files/
250250
# JetBrains Rider
251251
.idea/
252252
*.sln.iml
253+
xidel/
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Source : https://leetcode.com/problems/longest-palindromic-substring/
2+
// Author : codeyu
3+
// Date : 2016-09-22
4+
5+
/***************************************************************************************
6+
*
7+
* Given a string S, find the longest palindromic substring in S. You may assume that
8+
* the maximum length of S is 1000, and there exists one unique longest palindromic
9+
* substring.
10+
***************************************************************************************/
11+
12+
namespace Algorithms
13+
{
14+
public class Solution005
15+
{
16+
public static string LongestPalindromicSubstring(string s)
17+
{
18+
return "";
19+
}
20+
}
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using Algorithms;
2+
using Xunit;
3+
namespace AlgorithmsTest
4+
{
5+
public class LongestPalindromicSubstringTest
6+
{
7+
[Theory]
8+
[InlineData("XMADAMYX", "MADAM")]
9+
[InlineData("bbba", "bbb")]
10+
[InlineData("googlelevel", "level")]
11+
public void Test_LongestPalindromicSubstring(string input, string output)
12+
{
13+
Assert.Equal(output,Solution005.LongestPalindromicSubstring(input));
14+
}
15+
}
16+
}

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ LeetCode
1010
|001|[Two Sum](https://leetcode.com/problems/two-sum/) | [C#](./Algorithms/TwoSum.cs)|Easy|
1111
|002|[Add Two Numbers](https://leetcode.com/problems/add-two-numbers/) | [C#](./Algorithms/AddTwoNumbers.cs)|Medium|
1212
|003|[Longest Substring Without Repeating Characters](https://leetcode.com/problems/longest-substring-without-repeating-characters/) | [C#](./Algorithms/LengthOfLongestSubstring.cs)|Medium|
13-
|004|[Median of Two Sorted Arrays](https://leetcode.com/problems/median-of-two-sorted-arrays/) | [C#](./Algorithms/FindMedianSortedArrays.cs) |Hard|
13+
|004|[Median of Two Sorted Arrays](https://leetcode.com/problems/median-of-two-sorted-arrays/) | [C#](./Algorithms/FindMedianSortedArrays.cs) |Hard|
14+
|005|[Longest Palindromic Substring](https://leetcode.com/problems/longest-palindromic-substring/) | [C#](./Algorithms/LongestPalindromicSubstring.cs)|Medium|

Scripts/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ The comments would be generated by above examples as below:
5858
For example:
5959

6060
```
61-
$ ./readme.sh ../algorithms/cpp/nextPermutation/nextPermutation.cpp
62-
|31|[Next Permutation](https://oj.leetcode.com/problems/next-permutation/) | [C++](./algorithms/cpp/nextPermutation/nextPermutation.cpp)|Medium|
61+
$ ./readme.sh ../Algorithms/TwoSumTest.cs
62+
|001|[Two Sum](https://leetcode.com/problems/two-sum/) | [C#](./Algorithms/TwoSum.cs)|Easy|
6363
```
6464

Scripts/comments.sh

100644100755
File mode changed.

Scripts/readme.sh

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ NUM=`echo ${title_str} | awk -F '.' '{print $1}'`
2828
TITLE=`echo ${title_str} | awk -F '.' '{print $2}' | sed -e 's/^[[:space:]]*//'`
2929
DIFFCULT=`xidel ${URL} -q -e "css('.question-info')" | grep Difficulty | awk '{print $2}'`
3030

31-
FILE=`echo ${FILE} | sed "s/.*\/algorithms/\.\/algorithms/"`
31+
FILE=`echo ${FILE} | sed "s/.*\/Algorithms/\.\/Algorithms/"`
3232

3333
echo "|${NUM}|[${TITLE}](${URL}) | [C#](${FILE})|${DIFFCULT}|"

0 commit comments

Comments
 (0)