Daily Coding Challenge - Left-Handed Seat at the Table

Tell us what’s happening:

Please explain why Test #3 should return “0”, but Test #1 can return “2”. In my code, and mental logic, my results for #3 should return “1”

Your code so far

def find_left_handed_seats(table):
    availableSpots = 0
    leftSide = table[0]
    rightSide = table[1]

    toLeft = ""
    for l in leftSide:
        print(l)
        if l == "U":
            if toLeft != "R": 
                print("added left")
                availableSpots += 1
                toLeft = "L"
                continue
        toLeft = l

    toLeft = ""    
    for r in rightSide:
        print(r)
        if r == "U":
            if toLeft != "R": 
                print("added right")
                availableSpots += 1
                toLeft = "L"
                continue
        toLeft = r

    return availableSpots

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64; rv:146.0) Gecko/20100101 Firefox/146.0

Challenge Information:

Daily Coding Challenge - Left-Handed Seat at the Table

https://www.freecodecamp.org/learn/daily-coding-challenge/2026-01-03

Hi @etcSudoers and welcome to our community!

find_left_handed_seats([["U", "R", "U", "R"], ["L", "R", "R", "U"]]) should return 0

This is correct. Remember that the top row is essentially flipped, as it’s two sides of the same table. So, from that perspective, both empty chairs in the top row have a right-handed person sitting to their left.

The bottom row empty chair also has a right-handed person sitting to their left.

So, none of the unoccupied chairs can be occupied by a left-handed person.