Question
Answer the questions based on the information given
below. Six boxes R, S, T, U, V and W are kept one above another such that bottommost box is numbered as 1 and box above it is numbered as 2 and so on. R is two boxes above S. Only two boxes are between R and W. As many boxes are kept above S as below V. At most two boxes are kept between T and U. T is not kept adjacent to V. Which box is kept two boxes above T?Solution
R is two boxes above S. Only two boxes are between R and W. As many boxes are kept above S as below V. There will be two cases: If R is kept at place no. 5, then S will be kept at place no. 3. W will be kept at place no. 2. As three boxes are above S, so V will be kept at place no. 4. If R is kept at place no. 4, then S will be kept at place no. 2. W will be kept at place no. 1. As four boxes are above S, so V will be kept at place no. 5. At most two boxes are kept between T and U. T is not kept adjacent to V. Case 1 will get discarded as we cannot place T and U. If T is kept at place no. 3, then U will be kept at place no. 6.
Final arrangement as shown below:
What does #!/bin/bash at the start of a script mean?
Extended globbing in bash allows:
Which operator enables process substitution in bash (e.g., diff <(cmd1) <(cmd2))?
Which symbol is used for logical AND in shell scripting?
Which command is used to search for a pattern in files?
Which operator enables process substitution?
Which symbol is used in shell scripting to reference a positional parameter, e.g., the first argument passed to a script?
Which operator is used to append output to a file?
Which command is used to read user input from the keyboard and store it in a variable?
In shell scripting, how do you assign the string "Hello World" to a variable named `MESSAGE`?