/**
 * Counts the number of left and right shifts performed by a police officer during a car chase.
 *
 * @param trafficData A dictionary representing the traffic data for the car chase.
 * @return The total number of left and right shifts performed by the police officer.
 *
 * Exercise:
 * - Write code to iterate over each entry in the traffic data dictionary.
 * - For every entry, check if the police officer has performed a left shift or a right shift.
 * - If a left shift is found, increment a variable by 1.
 * - If a right shift is found, increment the same variable by 1.
 * - Finally, return the total count of left and right shifts performed by the police officer.
 *
 * Difficulty Level: Very Difficult
 */
fun countShiftsOffense(trafficData: Map<String, String>): Int {

    var shiftCount = 0
    for (entry in trafficData) {
        if (entry.value == "<<" || entry.value == ">>") {
            shiftCount++
        }
    }
    return shiftCount
}
/**
 * Counts the number of left and right shifts performed by a police officer during a car chase.
 *
 * @param trafficData A dictionary representing the traffic data for the car chase.
 * @return The total number of left and right shifts performed by the police officer.
 *
 * Exercise:
 * - Write code to iterate over each entry in the traffic data dictionary.
 * - For every entry, check if the police officer has performed a left shift or a right shift.
 * - If a left shift is found, increment a variable by 1.
 * - If a right shift is found, increment the same variable by 1.
 * - Finally, return the total count of left and right shifts performed by the police officer.
 *
 * Difficulty Level: Very Difficult
 */
fun countShiftsOffense(trafficData: Map<String, String>): Int {
/**
 * Counts the number of left and right shifts performed by a police officer during a car chase.
 *
 * @param trafficData A dictionary representing the traffic data for the car chase.
 * @return The total number of left and right shifts performed by the police officer.
 *
 * Exercise:
 * - Write code to iterate over each entry in the traffic data dictionary.
 * - For every entry, check if the police officer has performed a left shift or a right shift.
 * - If a left shift is found, increment a variable by 1.
 * - If a right shift is found, increment the same variable by 1.
 * - Finally, return the total count of left and right shifts performed by the police officer.
 *
 * Difficulty Level: Very Difficult
 */
fun countShiftsOffense(trafficData: Map<String, String>): Int {

    var shiftCount = 0
    for (entry in trafficData) {
        if (entry.value == "<<" || entry.value == ">>") {
            shiftCount++
        }
    }
    return shiftCount
}