KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I recently encountered the following interview question: How can you multiply a number by 7 in an efficient and optimized way? I know that I can multiply by 8 (or left-shift by three bits) and then subtract the original value: num = (num << 3) - num; but are there any other solutions.
Tags (comma-separated)
Save Edits
Cancel