From d9dd2d8bdfd6eccf1ce5c096f20ef1ddfdb102eb Mon Sep 17 00:00:00 2001 From: Dale Seo Date: Mon, 17 Nov 2025 14:56:40 -0500 Subject: [PATCH 1/2] ci: remove merge group trigger from integration workflow --- .github/workflows/integration.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index a7cff2614..440ed01a5 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -2,12 +2,10 @@ name: Integration 🔄 on: pull_request: - merge_group: jobs: linelint: runs-on: ubuntu-latest - if: github.event_name == 'pull_request' steps: - uses: actions/checkout@v4 with: From 5d3bf6aa8430e41f369d652d633e7662f1a6657d Mon Sep 17 00:00:00 2001 From: Dale Seo Date: Wed, 19 Nov 2025 20:36:44 -0500 Subject: [PATCH 2/2] linked-list-cycle --- linked-list-cycle/DaleSeo.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 linked-list-cycle/DaleSeo.rs diff --git a/linked-list-cycle/DaleSeo.rs b/linked-list-cycle/DaleSeo.rs new file mode 100644 index 000000000..bd88e1f4b --- /dev/null +++ b/linked-list-cycle/DaleSeo.rs @@ -0,0 +1,28 @@ +// Definition for singly-linked list. +#[derive(PartialEq, Eq, Clone, Debug)] +pub struct ListNode { + pub val: i32, + pub next: Option>, +} + +// TC: O(n) +// SC: O(1) +impl Solution { + pub fn has_cycle(head: Option>) -> bool { + let mut slow = &head; + let mut fast = &head; + + while fast.is_some() && fast.as_ref().unwrap().next.is_some() { + slow = &slow.as_ref().unwrap().next; + fast = &fast.as_ref().unwrap().next.as_ref().unwrap().next; + + if slow.as_ref().map(|node| node.as_ref() as *const _) + == fast.as_ref().map(|node| node.as_ref() as *const _) + { + return true; + } + } + + false + } +}