/**
 * This function takes a list of dancer's moves expressed as integer values and returns the resulting direction.
 * The OR operator is used to combine the directions given by each move. The dance floor is a 1-D space where
 * positive values represent moving to the right and negative values represent moving to the left.
 *
 * Example:
 * - Given the steps = [3, -2, 4, -1], the resulting direction is 4, as 3 OR -2 OR 4 OR -1 gives 4.
 *
 * @param steps A list of integer values representing the dancer's moves.
 * @param direction The initial direction (positive or negative) before performing any steps.
 * @return The resulting direction after performing all the given steps using the OR operator.
 */
fun dancerMoves(steps: List<Int>, direction: Int): Int {

    var resultDirection = direction
    for (step in steps) {
        resultDirection = if (step > 0) {
            resultDirection or step
        } else {
            resultDirection or (step + (1 shl 32))  // Considering the negative integers using two's complement
        }
    }
    return resultDirection
}
/**
 * This function takes a list of dancer's moves expressed as integer values and returns the resulting direction.
 * The OR operator is used to combine the directions given by each move. The dance floor is a 1-D space where
 * positive values represent moving to the right and negative values represent moving to the left.
 *
 * Example:
 * - Given the steps = [3, -2, 4, -1], the resulting direction is 4, as 3 OR -2 OR 4 OR -1 gives 4.
 *
 * @param steps A list of integer values representing the dancer's moves.
 * @param direction The initial direction (positive or negative) before performing any steps.
 * @return The resulting direction after performing all the given steps using the OR operator.
 */
fun dancerMoves(steps: List<Int>, direction: Int): Int {
/**
 * This function takes a list of dancer's moves expressed as integer values and returns the resulting direction.
 * The OR operator is used to combine the directions given by each move. The dance floor is a 1-D space where
 * positive values represent moving to the right and negative values represent moving to the left.
 *
 * Example:
 * - Given the steps = [3, -2, 4, -1], the resulting direction is 4, as 3 OR -2 OR 4 OR -1 gives 4.
 *
 * @param steps A list of integer values representing the dancer's moves.
 * @param direction The initial direction (positive or negative) before performing any steps.
 * @return The resulting direction after performing all the given steps using the OR operator.
 */
fun dancerMoves(steps: List<Int>, direction: Int): Int {

    var resultDirection = direction
    for (step in steps) {
        resultDirection = if (step > 0) {
            resultDirection or step
        } else {
            resultDirection or (step + (1 shl 32))  // Considering the negative integers using two's complement
        }
    }
    return resultDirection
}