Skip to content

Conversation

@arty0928
Copy link
Member

📌 PR 내용

제목 소요시간 비고
리트코드_Two sum ⏱ 20m
리트코드_Word Search ⏱30m
리트코드_Permutation ⏱30m
리트코드_Combination ⏱30m
리트코드_Subsets ⏱20m
리트코드_Binary Search ⏱5m
리트코드_Palindrome Partitioning ⏱30m
리트코드_Word Search ⏱60m
리트코드_N-Queen ⏱70m

@arty0928 arty0928 requested review from kny0ng125 and sbi1024 August 26, 2025 02:29
@arty0928 arty0928 self-assigned this Aug 26, 2025
class Solution {
public int[] twoSum(int[] nums, int target) {
Map<Integer,Integer> hm = new HashMap<>();

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

기존 코드도 깔끔한데 추가로 최적화하는 방안 생각하는 거 좋습니다

if(visited[pre]==t) return false; //이미 지난
// 🔍 [행 차 == 열 차
if(Math.abs(pre - now) == Math.abs(visited[pre] - t)) return false;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

행 차 열 차 절댓값으로 계산하는 건 생각 못했던 부분이라서 괜찮은 것 같아요

@kny0ng125 kny0ng125 merged commit 72439b7 into main Aug 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants