statement result += unsigned int(1) < < i;
can be compiled and run locally, but a compilation error appears after uploading to LeetCode: expected primary-expression before ‘unsigned’.
analysis:
statement is too complex, the compiler on LeetCode can not fully compile, need to add the basic expression.
solution:
1 for unsigned int
add parentheses: (unsigned int)
.
2 add intermediate variable unsigned int one = 1; result += one < < I code>.
Read More:
- JAVA lambda Syntax error on tokens, Expression expected instead
- C code compilation_ Error: expected expression before ‘Int’
- Syntax Error: SassError: Invalid CSS after “…-height: #{math“: expected expression (e.g. 1px, bold
- error Expected an assignment or function call and instead saw an expression
- _ASSERTE((unsigned)(c + 1) <= 256);
- error C2057: expected constant expression (Can the size of an array in C language be defined when the program is running?)
- The solution of duplicate entry ‘for key’ primary ‘when inserting data in MySQL
- Txt import MySQL: error 1062 (23000): duplicate entry ‘0’ for key ‘primary’
- Duplicate entry ‘787192513’ for key ‘primary’
- Stm32f103c8t6 in keil compiler error: # 67: expected a “}” solution
- The reason and solution of the error of join function: sequence item 0: expected STR instance, int found
- C language error – [error] expected declaration or statemt at end of input— solution.
- [reprint and save] MySQL does not set the primary key and uses the self growing ID method
- MySQL creates tables and sets auto increment of primary keys
- docker apache php-fpm AH01071: Got error ‘Primary script unknown\n’
- Failed to notify ProjectEvaluationListener.afterEvaluate(), but primary configuration failure takes
- How to Fix Warning: Statement lambda can be replaced with expression lambda
- Error Code: 1055. Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated
- Solve the problem that vscode cannot convert the easy less plug-in to the less expression value
- [Solved] Unity Error: Assertion failed on expression: ‘m_ErrorCode == MDB_MAP_RESIZED