first solution

forgot to consider duplicated solution