9 balls, 3red,3blue,3green. how many options we have, so no 3 same colored balls adj. So, we have 9 balls. 3 red, 3 blue and 3 green balls.
Balls with the same color are identical.
What is the number of options to arrange them on the line, with a condition that there won't be 3 same color adjacent balls.
Hints would be very appreciated too.
 A: I would recommend approaching via Inclusion-Exclusion.
You should know from earlier work that if we ignore the condition that no adjacent three balls are of the same color, there will be $\binom{9}{3,3,3}=\frac{9!}{3!3!3!}$ number of arrangements.  Let $U$ be the set of all arrangements regardless of if they violate the condition.
Let $A_r$ be the subset of these arrangements that have three reds in a row, $A_b$ be the number of arrangements that have three blues in a row, and $A_g$ be the number of arrangements that have three greens in a row.
For example, in $A_r$ you could have the arrangement $rrrbbgbgg$ or $brrrbbggg$, etc...  Note, it is possible that an arrangement in $A_r$ is also in $A_g$ or $A_b$.
We are interested in finding $|U\setminus (A_r\cup A_g\cup A_b)|$
To do so, we know $|U\setminus (A_r\cup A_g\cup A_b)|=|U|-|A_r\cup A_g\cup A_b|$
Applying inclusion-exclusion on the final part, we have:
$=|U|-|A_r|-|A_b|-|A_g|+|A_r\cap A_b|+|A_r\cap A_g|+|A_b\cap A_g|-|A_r\cap A_b\cap A_g|$

How do we count something like $|A_r|$?
Imagine that all three of the red balls are stringed together.  So, we have the following balls to mix around.  $~^rr_r,b,b,b,g,g,g$.  How many ways can these be arranged?

 There are essentially 7 "balls", one of which red, three of which blue, and three of which green for a total of $\binom{7}{1,3,3}=\frac{7!}{1!3!3!}$ arrangements.

For counting something like $|A_r\cap A_b|$ imagine the red balls are stringed together and the blue balls are stringed together.  So, we wish to arrange $~^rr_r,~^bb_b,g,g,g$.  How many ways can these be arranged?

 There are essentially 5 "balls", one of which red, one of which blue, and three of which green.  There are then $\binom{5}{1,1,3}=\frac{5!}{1!1!3!}$ number of arrangements.


Combining all information together we have a final count being

 $$\binom{9}{3,3,3} - 3\binom{7}{1,3,3}+3\binom{5}{1,1,3}-\binom{3}{1,1,1}=1314$$

A: Use the principle of inclusion and exclusion. Say an arrangement has the "red" property if all red balls are together, and so for the other colors. You want to count the arrangements without any of the properties.
