You finished each leg with a wrong side row so that means your next row that you're ready to work is a right side row. Take your 1st leg stitches and knit across them (18 stitches), then turn your work around, in other words it will be back in your left hand. Cast on 3 stitches -- you can use a knitting on cast on or a cable cast on, videos for both can be found here
. They both say to start with a slip knot but you can use these cast ons mid-project and instead of using a slip knot you will follow the instructions using the first stitch on your left needle.
Once you have cast on 3 more stitches (you will now have 21 stitches on needle), you will turn your work around again so now these 21 stitches will be on the needle held in your right hand. Now you will knit the other set of 18 stitches using the needle that is currently holding the 21 stitches you just finished with. This is a total of 39 stitches. 18 for each leg and 3 for the crotch area.
Because you started each leg seperately, you will have a ball of yarn from each. Once you have joined the two legs together by the method above, the ball of yarn from the second set of 18 stitches can be cut, leaving a good length (6" is good) tail for weaving in later. You will continue on using just the one ball of yarn since it is now one piece.