From 8d52243f72bbab51bb7f94b9e80d548a38306fb0 Mon Sep 17 00:00:00 2001 From: seanlancekim0 <122666778+seanlancekim0@users.noreply.github.com> Date: Mon, 5 Jun 2023 21:09:45 +0900 Subject: [PATCH 1/7] =?UTF-8?q?1603=EB=B2=88=20=EC=9A=B0=EC=88=98=20?= =?UTF-8?q?=ED=92=80=EC=9D=B4=20=EB=93=B1=EB=A1=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1603. Design Parking System/README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 1603. Design Parking System/README.md diff --git a/1603. Design Parking System/README.md b/1603. Design Parking System/README.md new file mode 100644 index 0000000..37f31c0 --- /dev/null +++ b/1603. Design Parking System/README.md @@ -0,0 +1,26 @@ +# 1603. Design Parking System + +[Design Parking System](https://leetcode.com/problems/design-parking-system/) + +## 김시현 - 2023.05.29 + +- 클래스 내 메소드 구현 + +```java +class ParkingSystem { + int[] park; + + public ParkingSystem(int big, int medium, int small) { + park = new int[] {big, medium, small}; + } + + public boolean addCar(int carType) { + return park[carType - 1]-- > 0; + } +}/*carType이 정수 1,2,3으로 입력받아서 배열의 index로 이용하면 +편할 것 같아서 park 배열을 선언하고 값을 넣어줬다. +배열의 값이 0보다 크기만 하면 공간이 있다는 뜻이므로 true를 return한다. +park배열을 ParkingSystem에서 한 번에 초기화하면 코드가 더 깔끔해질 것 같다.*/ +``` + +--- From a91a4deed596fa88681ff04afbfc5379f0d3f76d Mon Sep 17 00:00:00 2001 From: seanlancekim0 <122666778+seanlancekim0@users.noreply.github.com> Date: Tue, 6 Jun 2023 14:31:42 +0900 Subject: [PATCH 2/7] Update README.md --- 1603. Design Parking System/README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/1603. Design Parking System/README.md b/1603. Design Parking System/README.md index 37f31c0..61c1f21 100644 --- a/1603. Design Parking System/README.md +++ b/1603. Design Parking System/README.md @@ -5,6 +5,10 @@ ## 김시현 - 2023.05.29 - 클래스 내 메소드 구현 +- carType이 정수 1,2,3으로 입력받아서 배열의 index로 이용하면 +편할 것 같아서 park 배열을 선언하고 값을 넣어줬다. +- 배열의 값이 0보다 크기만 하면 공간이 있다는 뜻이므로 true를 return한다. +- park배열을 ParkingSystem에서 한 번에 초기화해서 코드를 더 깔끔하게 수정하였다. ```java class ParkingSystem { @@ -17,10 +21,7 @@ class ParkingSystem { public boolean addCar(int carType) { return park[carType - 1]-- > 0; } -}/*carType이 정수 1,2,3으로 입력받아서 배열의 index로 이용하면 -편할 것 같아서 park 배열을 선언하고 값을 넣어줬다. -배열의 값이 0보다 크기만 하면 공간이 있다는 뜻이므로 true를 return한다. -park배열을 ParkingSystem에서 한 번에 초기화하면 코드가 더 깔끔해질 것 같다.*/ +} ``` --- From 70768de826cac088ddaf070b0bc5cfd2cf7e40f6 Mon Sep 17 00:00:00 2001 From: seanlancekim0 <122666778+seanlancekim0@users.noreply.github.com> Date: Thu, 29 Jun 2023 23:23:29 +0900 Subject: [PATCH 3/7] =?UTF-8?q?477=EB=B2=88=20=EC=9A=B0=EC=88=98=ED=92=80?= =?UTF-8?q?=EC=9D=B4=20=EB=93=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 744. Find Smallest Letter Greater Than Target/README.md diff --git a/744. Find Smallest Letter Greater Than Target/README.md b/744. Find Smallest Letter Greater Than Target/README.md new file mode 100644 index 0000000..555d19d --- /dev/null +++ b/744. Find Smallest Letter Greater Than Target/README.md @@ -0,0 +1,17 @@ +# 744. Find Smallest Letter Greater Than Target + +[Find Smallest Letter Greater Than Target](https://leetcode.com/problems/find-smallest-letter-greater-than-target/) + +## 김시현 - 2023.06.09 + +- letters배열에 for문 돌면서 저장된 아스키코드값을 비교해 target보다 크면 return +- 배열에 더 큰 값이 없다면 letters[0] return + +```java +class Solution { + public char nextGreatestLetter(char[] letters, char target) { + for(var c: letters) if(c > target) return c; + return letters[0]; + } +} +``` From 50cab4f13b621e3571fe9c7ffe94f28491889674 Mon Sep 17 00:00:00 2001 From: seanlancekim0 <122666778+seanlancekim0@users.noreply.github.com> Date: Thu, 29 Jun 2023 23:27:19 +0900 Subject: [PATCH 4/7] =?UTF-8?q?1732=EB=B2=88=20=EC=9A=B0=EC=88=98=20?= =?UTF-8?q?=ED=92=80=EC=9D=B4=20=EB=93=B1=EB=A1=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1732. Find the Highest Altitude/README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 1732. Find the Highest Altitude/README.md diff --git a/1732. Find the Highest Altitude/README.md b/1732. Find the Highest Altitude/README.md new file mode 100644 index 0000000..f8b1584 --- /dev/null +++ b/1732. Find the Highest Altitude/README.md @@ -0,0 +1,20 @@ +# 1732. Find the Highest Altitude + +[Find Smallest Letter Greater Than Target](https://leetcode.com/problems/find-smallest-letter-greater-than-target/) + +## 김시현 - 2023.06.19 + +- for문 돌면서 sum에 더하여 저장, sum이 max보다 큰 경우 바꿔줌 + +```java +class Solution { + public int largestAltitude(int[] gain) { + int sum = 0, max = 0; + for(int i = 0; i < gain.length; i++) { + sum += gain[i]; + max = Math.max(sum, max); + } + return max; + } +} +``` From f16ea45670eab707e9031474a307bde9289218c6 Mon Sep 17 00:00:00 2001 From: seanlancekim0 <122666778+seanlancekim0@users.noreply.github.com> Date: Thu, 29 Jun 2023 23:29:13 +0900 Subject: [PATCH 5/7] Create README.md --- 2490. Circular Sentence/README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 2490. Circular Sentence/README.md diff --git a/2490. Circular Sentence/README.md b/2490. Circular Sentence/README.md new file mode 100644 index 0000000..fc57297 --- /dev/null +++ b/2490. Circular Sentence/README.md @@ -0,0 +1,22 @@ +# 2490. Circular Sentence + +[Circular Sentence](https://leetcode.com/problems/circular-sentence/) + +## 김시현 - 2023.06.29 + +- sentence를 공백으로 나누어 String 배열에 넣어주고 for문 돌면서 +마지막 문자와 다음 String 첫 문자를 비교해준다. + +```java +class Solution { + public boolean isCircularSentence(String sentence) { + String[] str = sentence.split(" "); + for(int i = 0; i < str.length; i++) { + if(str[i].charAt(str[i].length() - 1) + != str[(i + 1) % str.length].charAt(0)) + return false; + } + return true; + } +} +``` From d3c733440b395ff2a2ee28b549ac891716e27abb Mon Sep 17 00:00:00 2001 From: seanlancekim0 <122666778+seanlancekim0@users.noreply.github.com> Date: Thu, 29 Jun 2023 23:29:37 +0900 Subject: [PATCH 6/7] =?UTF-8?q?2490=EB=B2=88=20=EC=9A=B0=EC=88=98=20?= =?UTF-8?q?=ED=92=80=EC=9D=B4=20=EB=93=B1=EB=A1=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 2490. Circular Sentence/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2490. Circular Sentence/README.md b/2490. Circular Sentence/README.md index fc57297..90346b4 100644 --- a/2490. Circular Sentence/README.md +++ b/2490. Circular Sentence/README.md @@ -18,5 +18,5 @@ class Solution { } return true; } -} +} ``` From ce519570be0ce7f318a6343451caaa5be3f2e845 Mon Sep 17 00:00:00 2001 From: seanlancekim0 <122666778+seanlancekim0@users.noreply.github.com> Date: Thu, 29 Jun 2023 23:32:32 +0900 Subject: [PATCH 7/7] =?UTF-8?q?1603=EB=B2=88=20=EC=9A=B0=EC=88=98=20?= =?UTF-8?q?=ED=92=80=EC=9D=B4=20=EB=93=B1=EB=A1=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1603. Design Parking System/README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/1603. Design Parking System/README.md b/1603. Design Parking System/README.md index 61c1f21..d3262e5 100644 --- a/1603. Design Parking System/README.md +++ b/1603. Design Parking System/README.md @@ -5,8 +5,7 @@ ## 김시현 - 2023.05.29 - 클래스 내 메소드 구현 -- carType이 정수 1,2,3으로 입력받아서 배열의 index로 이용하면 -편할 것 같아서 park 배열을 선언하고 값을 넣어줬다. +- carType이 정수 1,2,3으로 입력받아서 배열의 index로 이용하면 편할 것 같아서 park 배열을 선언하고 값을 넣어줬다. - 배열의 값이 0보다 크기만 하면 공간이 있다는 뜻이므로 true를 return한다. - park배열을 ParkingSystem에서 한 번에 초기화해서 코드를 더 깔끔하게 수정하였다. @@ -23,5 +22,3 @@ class ParkingSystem { } } ``` - ----