From faf86af1fbb768f7ea95d137f728c1543d384da0 Mon Sep 17 00:00:00 2001 From: ymir0804 Date: Wed, 26 Nov 2025 23:27:33 +0900 Subject: [PATCH 1/2] =?UTF-8?q?Climbing=20Stairs=20=EB=AC=B8=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- climbing-stairs/ymir0804.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 climbing-stairs/ymir0804.java diff --git a/climbing-stairs/ymir0804.java b/climbing-stairs/ymir0804.java new file mode 100644 index 0000000000..30c09e3810 --- /dev/null +++ b/climbing-stairs/ymir0804.java @@ -0,0 +1,22 @@ +class Solution { + public int climbStairs(int n) { + int result = 0; + int first = 1; + int second = 2; + int third = 3; + if (n == 1) { + return first; + } else if (n == 2) { + return second; + } else if (n == 3) { + return third; + } + + for (int i = 4; i <= n; i++) { + result = second + third; + second = third; + third = result; + } + return result; + } +} \ No newline at end of file From 10a94974e6271d716a4dffbf8144686ba891cda2 Mon Sep 17 00:00:00 2001 From: ymir0804 Date: Sat, 29 Nov 2025 23:32:11 +0900 Subject: [PATCH 2/2] =?UTF-8?q?lint=20=EC=A1=B0=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- climbing-stairs/ymir0804.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/climbing-stairs/ymir0804.java b/climbing-stairs/ymir0804.java index 30c09e3810..c3c2e3695a 100644 --- a/climbing-stairs/ymir0804.java +++ b/climbing-stairs/ymir0804.java @@ -19,4 +19,4 @@ public int climbStairs(int n) { } return result; } -} \ No newline at end of file +}