Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a5d5ad0

Browse files
committedDec 4, 2024
added more annotations and trailing newline
1 parent 78c3a0a commit a5d5ad0

File tree

91 files changed

+130
-129
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+130
-129
lines changed
 

‎0009-palindrome-number.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ class Solution {
1212
bool isPalindrome(int x) {
1313
if (x < 0) return false;
1414
// Reverse digits
15-
long y = 0;
16-
int x2 = x;
15+
long y = 0; // we have to use a long because some inputs
16+
int x2 = x; // exceed 2^31-1 when reversed
1717
while (x2 != 0) {
1818
y *= 10;
1919
y += x2 % 10;

‎0014-longest-common-prefix.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ char* longestCommonPrefix(char** strs, int strsSize) {
2222
for (unsigned char i = 0; i < len_shortest; i++) {
2323
for (char** p = strs; p != strsEnd; ++p ) {
2424
char* str = *p;
25-
// this means that the prefix ends here
25+
// not equal, prefix ends here
2626
if (str[i] != strs[0][i]) return prefix;
2727
}
2828
prefix[i] = strs[0][i];

0 commit comments

Comments
 (0)
Please sign in to comment.