Command Substitution
Command substitution allows the output of a command to replace the command itself in a shell script or command line.
`command`
$(command)
Example:
echo "Today is $(date)"
echo "Nested: $(echo $(date))"
paulpeng changed 3 months agoView mode Like Bookmark
contributed by < paulpeng-popo >
Prerequisites
In order to avoid affecting the original computer environment, a container is set up to provide the experimental environment for Assignment 3.
Here, I use Docker for building container.
FROM arm64v8/ubuntu:22.04
# set the working directory
paulpeng changed a year agoView mode Like Bookmark
contributed by < paulpeng-popo >
Choose a question
I selected Bitwise AND of Numbers Range from JoshuaLee, because its concept is similar to my topic which I have chosen in assignment 1.
Analyzation of Original code
This question is asking us to find the common prefix of left and right 's binary code.
To find the common prefix of left and right, we can shift both of them to the right until they are equal.
int rangeBitwiseAnd(int left, int right) {
Jim Huang changed a year agoView mode Like Bookmark