Counting repeating numbers in an Array

前端 未结 5 1671
生来不讨喜
生来不讨喜 2020-12-22 02:53

Fairly new to C#. Have an assignment for class that asks us to generate an array from user inputted values. This part is done and work\'s perfectly.

Now that the arr

5条回答
  •  情书的邮戳
    2020-12-22 03:20

    Are you allow to use LINQ? If so, investigate GroupBy and Count(). Basically there's a one-liner which will work here, but as it's homework I'll let you work out the details for yourself... ask for more help when you've had a go though, if you run into problems.

提交回复
热议问题