using System.Diagnostics;
using System.Collections.Generic;
public static void Main()
var sw = new Stopwatch();
for(int i = 0; i < 1000000; i++)
Console.WriteLine(sw.ElapsedMilliseconds);
for(int i = 0; i < 1000000; i++)
Console.WriteLine(sw.ElapsedMilliseconds);
for(int i = 0; i < 1000000; i++)
Console.WriteLine(sw.ElapsedMilliseconds);
for(int i = 0; i < 1000000; i++)
Console.WriteLine(sw.ElapsedMilliseconds);
static bool NazaRN(string str1, string str2){
var areEqual = Enumerable.SequenceEqual(str1.OrderBy(c => c), str2.OrderBy(c => c));
static bool CaiusJard1(string str1, string str2){
if(str1.Length != str2.Length) return false;
var c1 = str1.ToCharArray();
var c2 = str2.ToCharArray();
for(int i = c1.Length - 1; i >= 0; i--)
if(c1[i] != c2[i]) return false;
static bool CaiusJard1a(string str1, string str2){
if(str1.Length != str2.Length) return false;
var counts = new int[26];
for(int i = 0; i < str1.Length; i++){
var r = ++counts[str1[i] - 'a'];
if(r == 1) numPositive++;
for(int i = 0; i < str2.Length; i++){
var r = --counts[str1[i] - 'a'];
if(r == 0) numPositive--;
static bool CaiusJard2(string str1, string str2){
if(str1.Length != str2.Length) return false;
var d = new Dictionary<char, int>();
if(r == 1) numPositive++;
if(r == 0) numPositive--;
static bool CaiusJard3(string str1, string str2){
if(str1.Length != str2.Length) return false;
var d = new Dictionary<char, int>();
if(r == 1) numPositive++;
if(r == 0) numPositive--;
static bool IdleMind(string str1, string str2){
bool stringsAreEqual = (str1.Length == str2.Length);
List<char> str2chars = new List<char>(str2.ToCharArray());
foreach (char c in str1.ToCharArray()) {
int index = str2chars.IndexOf(c);
str2chars.RemoveAt(index);
stringsAreEqual = stringsAreEqual && (str2chars.Count == 0);
static bool MattWatson(string s1, string s2)
var lookup1 = s1.ToLookup(ch => ch);
var lookup2 = s2.ToLookup(ch => ch);
return lookup1.All(keyValue =>
lookup2.Contains(keyValue.Key) && keyValue.Count() == lookup2[keyValue.Key].Count());