20240523 Finished

This commit is contained in:
jackfiled 2024-05-23 10:17:15 +08:00
parent 9978017d28
commit df4e3e929c
6 changed files with 88 additions and 0 deletions

View File

@ -0,0 +1,13 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# Rider 忽略的文件
/contentModel.xml
/.idea.LeetCodeSharp.iml
/modules.xml
/projectSettingsUpdater.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
</project>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="UserContentModel">
<attachedFolders />
<explicitIncludes />
<explicitExcludes />
</component>
</project>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

View File

@ -0,0 +1,46 @@
// [141] Linked List Cycle
using System.Collections.Generic;
using LeetCodeSharp.Utils;
namespace LeetCodeSharp.Problems141
{
// Submission codes start here
/**
* Definition for singly-linked list.
* public class ListNode {
* public int val;
* public ListNode next;
* public ListNode(int x) {
* val = x;
* next = null;
* }
* }
*/
public class Solution
{
private readonly HashSet<ListNode> _visited = new HashSet<ListNode>();
public bool HasCycle(ListNode head)
{
_visited.Clear();
ListNode node = head;
while (node != null)
{
if (_visited.Contains(node))
{
return true;
}
_visited.Add(node);
node = node.next;
}
return false;
}
}
// Submission codes end here
}

11
commit.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/sh
set -e
time=$(date "+%Y%m%d")
message="$time Finished"
git add -A
git commit -m "$message"
git push