-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1366RankTeamsByVotes.cs
More file actions
81 lines (61 loc) · 2.28 KB
/
1366RankTeamsByVotes.cs
File metadata and controls
81 lines (61 loc) · 2.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//using System;
//using System.Collections.Generic;
//using System.Text;
//using System.Linq;
//namespace CodeForecs
//{
// class _1366RankTeamsByVotes
// {
// public class Solution
// {
// private char GetPosition(int position, List<char> positionHolders, IDictionary<int, List<char>> dict, string str)
// {
// if (positionHolders.Count == 1)
// return positionHolders[0];
// int i = 0;
// int size = positionHolders.Count;
// while(i < size - 1)
// {
// if()
// i++;
// }
// if(i == size - 1)
// {
// Array.Sort(str.ToCharArray());
// return str[0];
// }
// return positionHolders[i];
// }
// private bool GetEqualPosition(char A, char B, int position, IDictionary<int, List<char>> dict)
// {
// var lst = dict[position];
// int countA = lst.Count(x => x == A);
// int countB = lst.Count(x => x == B);
// return countA != countB ? (countA > countB ? countA : countB) : GetEqualPosition(A, B, position + 1, dict);
// }
// public string RankTeams(string[] votes)
// {
// int dictSize = votes[0].Length;
// string str = votes[0];
// IDictionary<int, List<char>> dict = new Dictionary<int, List<char>>();
// for(int i = 1; i <= dictSize; i++)
// {
// dict.Add(i, new List<char>());
// }
// foreach(string x in votes)
// {
// for(int i = 0; i < x.Length; i++)
// {
// dict[i].Add(x[i]);
// }
// }
// StringBuilder sb = new StringBuilder();
// foreach(KeyValuePair<int, List<char>> keyValuePair in dict)
// {
// sb.Append(GetPosition(keyValuePair.Key, keyValuePair.Value, dict, str));
// }
// return sb.ToString();
// }
// }
// }
//}