1. 02.01
  2. 02.02
  3. 02.03
  4. 02.04
  5. 02.05
  6. 02.06
  7. 02.07

Code Hunt SECTOR 02 LOOPS

02.01

1
2
3
4
5
6
7
using System;
using System.Linq;
public class Program {
public static int[] Puzzle(int n) {
return Enumerable.Range(0, n).ToArray();
}
}

02.02

1
2
3
4
5
6
7
using System;
using System.Linq;
public class Program {
public static int[] Puzzle(int n) {
return Enumerable.Range(0, n).Select(x => x * n).ToArray();
}
}

02.03

1
2
3
4
5
6
7
using System;
using System.Linq;
public class Program {
public static int[] Puzzle(int n) {
return Enumerable.Range(0, n).Select(x => x * x).ToArray();
}
}

02.04

1
2
3
4
5
6
7
using System;
using System.Linq;
public class Program {
public static int Puzzle(int[] v) {
return (int)v.Sum(x => (long)x);
}
}

02.05

1
2
3
4
5
6
7
using System;
using System.Linq;
public class Program {
public static int Puzzle(int n) {
return Enumerable.Range(0, n).Sum(x => x * x);
}
}

02.06

1
2
3
4
5
6
7
8
using System;
public class Program {
public static int Puzzle(string s) {
return s.Length
## s.Replace("a",
"").Length;
}
}

02.07

1
2
3
4
5
6
7
8
9
using System;
public class Program {
public static int Puzzle(string s, char x)
{
return s.Length
## s.Replace(""
+ x, "").Length;
}
}