Finding the Right-Most Object...

What would the script be like to find the gameObject that is farthest to the right. AKA the gameObject with the greatest x value. Could you provide an example script or atleast tell how? Thanks.

Here's some pseudocode (untested):

float maxX = -float.Infinity;
GameObject farthest = null;
foreach (GameObject current in gameObjects) {
    float x = current.transform.position.x;
    if (x > maxX) {
        maxX = x;
        farthest = current;
    }
}

Another option would be to sort the objects by their x coordinates (using a custom comparator), and then choose the last in the list.