Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions combination-sum/reeseo3o.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const combinationSum = (candidates, target) => {
const result = [];

const backtrack = (startIndex, current, remaining) => {
if (remaining === 0) {
result.push([...current]);
return;
}
if (remaining < 0) return;

for (let i = startIndex; i < candidates.length; i++) {
current.push(candidates[i]);
backtrack(i, current, remaining - candidates[i]);
current.pop();
}
};

backtrack(0, [], target);
return result;
};
1 change: 1 addition & 0 deletions number-of-1-bits/reeseo3o.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
const hammingWeight = (n) => n.toString(2).split("").filter(b => b === "1").length;
5 changes: 5 additions & 0 deletions valid-palindrome/reeseo3o.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const isPalindrome = (s) => {
const cleaned = s.toLowerCase().replace(/[^a-z0-9]/g, '');
const reversed = cleaned.split('').reverse().join('');
return cleaned === reversed;
Copy link
Contributor

Choose a reason for hiding this comment

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

저랑 동일하게 푸셨네요!

};
Loading