Skip to content
Closed
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
3 changes: 3 additions & 0 deletions reverse-bits/soobing.ts
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🏷️ 알고리즘 패턴 분석

  • 패턴: Bit Manipulation
  • 설명: 이 코드는 비트 연산을 활용하여 32비트 정수의 비트 순서를 뒤집는 문제로, 비트 조작을 통해 효율적으로 해결하는 패턴입니다.

Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@
* >>>, >>, <<, &, |
* - signed, unsigned 연산
*/

// test2
function reverseBits(n: number): number {
let result = 0;

for (let i = 0; i < 32; i++) {
result <<= 1;
result |= n & 1;
Expand Down
Loading