Toddler hitting

How do I get my toddler to stop hitting and kicking? She started doing it a couple weeks ago and she doesn’t do it only when she’s mad she does it all day long. Today she smacked a little girl for no reason at all and took another girls candy cane away from her. Idk how she learned to be such a brat but every time I yell at her and tell her no she just goes right back to hitting or kicking again. She’ll be 2 in February