From 6eeeaf333786074853ebafbd68d0ff97c7df7170 Mon Sep 17 00:00:00 2001 From: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Date: Fri, 29 May 2020 20:25:52 +0000 Subject: [PATCH] formatting source-code for 2829b58c9892f8e7e4d19772a14efe7118cfe132 --- leetcode/src/190.c | 12 ++++++------ leetcode/src/191.c | 11 ++++++----- leetcode/src/476.c | 2 +- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/leetcode/src/190.c b/leetcode/src/190.c index 0fc3306f..19e15f79 100644 --- a/leetcode/src/190.c +++ b/leetcode/src/190.c @@ -5,12 +5,12 @@ uint32_t reverseBits(uint32_t n) uint i; for (i = 0; i < TotalBits; i++) { - if ((n & - (UINT32_C(1) - << i))) // if the bit on the ith position of 32 bit input is 1, - // then proceed Further note the use of UINT32_C to convert - // 1 to unsigned 32 bit int, since just 1 is treated as int - // which cannot be shifted left more than 30 times + if ((n & (UINT32_C(1) + << i))) // if the bit on the ith position of 32 bit input is + // 1, then proceed Further note the use of UINT32_C to + // convert 1 to unsigned 32 bit int, since just 1 is + // treated as int which cannot be shifted left more + // than 30 times reverse_int = reverse_int | (UINT32_C(1) diff --git a/leetcode/src/191.c b/leetcode/src/191.c index b3c6c69d..169676da 100644 --- a/leetcode/src/191.c +++ b/leetcode/src/191.c @@ -4,11 +4,12 @@ int hammingWeight(uint32_t n) int i, weight = 0; for (i = 0; i < TotalBits; i++) { - if (n & (UINT32_C(1) - << i)) // if the bit on the ith position of 32 bit input is 1, - // then proceed Further note the use of UINT32_C to - // convert 1 to unsigned 32 bit int, as just 1 is treated - // as int which cannot be shifted left more than 30 times + if (n & + (UINT32_C(1) + << i)) // if the bit on the ith position of 32 bit input is 1, + // then proceed Further note the use of UINT32_C to + // convert 1 to unsigned 32 bit int, as just 1 is treated + // as int which cannot be shifted left more than 30 times weight += 1; } return weight; diff --git a/leetcode/src/476.c b/leetcode/src/476.c index 73a951d7..5a5825f9 100644 --- a/leetcode/src/476.c +++ b/leetcode/src/476.c @@ -7,7 +7,7 @@ int findComplement(int num) // standard size in memory, we cannot rely on size for that information. TotalBits++; // increment TotalBits till temp becomes 0 temp >>= 1; // shift temp right by 1 bit every iteration; temp loses 1 - // bit to underflow every iteration till it becomes 0 + // bit to underflow every iteration till it becomes 0 } int i, flipNumber =