Shovan Saha

Shovan Saha

  • NA
  • 321
  • 91.2k

datagridview count for person and fruit

Sep 20 2018 1:22 PM
I want to know how many types of fruit for Rohim / Karim / Shovan? I can clarify like this:
private void Form1_Load(object sender, EventArgs e)
{
AddRowsInDatagridView("Rohim", "Apple");
AddRowsInDatagridView("Karim", "Banana");
AddRowsInDatagridView("Karim", "Guava");
AddRowsInDatagridView("Rohim", "Coconut");
AddRowsInDatagridView("Karim", "Banana");
AddRowsInDatagridView("Rohim", "Jackfruit");
AddRowsInDatagridView("Rohim", "Apple");
AddRowsInDatagridView("Rohim", "Apple");
AddRowsInDatagridView("Karim", "Guava");
AddRowsInDatagridView("Rohim", "Palm");
AddRowsInDatagridView("Shovan", "Date");
AddRowsInDatagridView("Karim", "Banana");
}
Now my question: How many types of fruit are for Rahim?
Expected Answer : 4
How many types of fruit are for Karim?
Expected Answer : 2
How many types of fruit are for Shovan?
Expected Answer : 1

Answers (2)